var employeeDs = new Ext.data.ArrayStore({
storeId: 'empDs',
idIndex: 0,
fields: [{
name: 'employeeName',
type: 'string'
},{
name: 'mgrName',
type: 'string'
},{
name: 'income',
type: 'int'
}],
data: [
['Mike','',130000],
['Jim','Mike',92000],
['Alice','Mike',87000],
['Joe','Mike',72000],
['Andrew','Alice',67000],
['Bob','Jim',55000],
['Carol','Jim',56000],
['Kerry','Joe',62000]
]
});
alert(" ArrayStore complete..!" +
'\n'+'employeeDs : '+ employeeDs +
'\n'+'storeId : '+ employeeDs.storeId +
'\n'+'fields : ' + employeeDs.fields );
var employeeDs = Ext.create('Ext.data.ArrayStore', {
// store configs
autoDestroy: true,
storeId: 'myStore',
// reader configs
idIndex: 0,
fields:
[{
name: 'employeeName',
type: 'string'
},{
name: 'mgrName',
type: 'string'
},{
name: 'income',
type: 'int'
}],
data: [
['Mike','',130000],
['Jim','Mike',92000],
['Alice','Mike',87000],
['Joe','Mike',72000],
['Andrew','Alice',67000],
['Bob','Jim',55000],
['Carol','Jim',56000],
['Kerry','Joe',62000]
]
});
alert(" Data complete..!" +
'\n'+'employeeDs : '+ employeeDs +
'\n'+'storeId : '+ employeeDs.storeId +
'\n'+'fields : ' + employeeDs.fields +
'\n'+'my_model : ' );
Ext.define('employeeMd', {
extend: 'Ext.data.Model',
fields: [{
name: 'employeeName',
type: 'string'
},{
name: 'mgrName',
type: 'string'
},{
name: 'income',
type: 'int'
}]
});
alert('employeeMd : ' + employeeMd );
alert('employeeMd.constructor : ' + employeeMd.constructor );
alert('employeeMd.fields: ' + employeeMd.fields );
employeeMd = function() {
return this.constructor.apply(this,arguments);
}
y..
employeeMd.constructor = function Function() {[ native code ]}
Ext.define('employeeMd', {
extend: 'Ext.data.Model',
fields: [{
name: 'employeeName',
type: 'string'
},{
name: 'mgrName',
type: 'string'
},{
name: 'income',
type: 'int'
}],
constructor: function() {
//alert("Going to call parent's overriden constructor...");
this.callParent(arguments);
return this;
},
getFields: function() {
return this.fields;
}
});
var myModel = new employeeMd();
var myFields = myModel.getFields();
alert('employeeMd : ' + employeeMd );
alert('employeeMd.constructor : ' + employeeMd.constructor );
alert('myModel : ' + myModel );
alert('myFields : ' + myFields );
Ext.ux.GVisualizationPanel = Ext.extend(Ext.Panel, {
// ..mis nuevas propiedades..
},
//manejo de propiedades heredadas..
visualizationPkg: '',
html: 'Loading...',
store: null,
initComponent: function() {
..mi código de la extension..
},
onLoadCallback: function() {
..mi código de funciones complementarias..
}
});
// generacion del nombre de nuestra propiedad "xtype"
Ext.reg('gvisualization', Ext.ux.GVisualizationPanel);
Ext.define('Ext.ux.GVisualizationPanel ', {
extend: 'Ext.Panel',
alias: 'widget.gvisualization',
requires: ['Ext.window.MessageBox'],
//..mis nuevas propiedades y manejo de propiedades heredadas
initComponent : function(){
..mi código de la extension..
},
onLoadCallback: function() {
..mi código de funciones complementarias..
}
});
It looks like you're new here. If you want to get involved, click one of these buttons!
The content of this site is copyrighted by Quizzpot.com, it is prohibited to publish our tutorials on other blogs, magazines or any other media without prior permission.
Copyright © 2012 Quizzpot.
Our visitors are mostly developers and Web designers, advertise with us, you only need to contact us .