Cyberqat
10 Jun 2010, 4:12 PM
Hi All,
I'm wondering if anyone has some decent examples or tutorials on how to use Data Stores with ExtJS Designer?
i am trying to create a chooser dialog that has a list to chose from. I created the dialog and the data store using extjs. This resulted in the two code files below. What Im stumbling on a bit is what to add to the WorldChoser.js file and/or the WorldsListData.js file to end up with a dialog that I can instantiate with the data to be chosen from in an array passed in at instantiation time.
Any pointers on the ExtJS Designer friendly way to do this would be appreciated...
WorldChooserUi = Ext.extend(Ext.Window, {
title: 'World Chooser',
width: 318,
height: 250,
layout: 'border',
initComponent: function() {
this.items = [
{
xtype: 'grid',
title: 'Double click to go to a world....',
store: 'WorldsListData',
width: 304,
region: 'center',
height: 164,
columns: [
{
xtype: 'gridcolumn',
header: '',
sortable: true,
resizable: true,
width: 300,
dataIndex: 'worldname',
id: 'WorldName'
}
]
}
];
this.bbar = {
xtype: 'toolbar',
items: [
{
xtype: 'button',
text: 'Create World',
allowDepress: true,
ref: '../createWorldButton'
},
{
xtype: 'button',
text: 'Delete World',
autoWidth: true,
allowDepress: true,
ref: '../createWorldButton'
}
]
};
WorldChooserUi.superclass.initComponent.call(this);
}
});
This is the generated DataStore code:
WorldsListData = Ext.extend(Ext.data.ArrayStore, {
constructor: function(cfg) {
cfg = cfg || {};
WorldsListData.superclass.constructor.call(this, Ext.apply({
storeId: 'WorldsListData',
autoSave: false,
fields: [
{
name: 'worldname'
}
]
}, cfg));
}
});
I'm wondering if anyone has some decent examples or tutorials on how to use Data Stores with ExtJS Designer?
i am trying to create a chooser dialog that has a list to chose from. I created the dialog and the data store using extjs. This resulted in the two code files below. What Im stumbling on a bit is what to add to the WorldChoser.js file and/or the WorldsListData.js file to end up with a dialog that I can instantiate with the data to be chosen from in an array passed in at instantiation time.
Any pointers on the ExtJS Designer friendly way to do this would be appreciated...
WorldChooserUi = Ext.extend(Ext.Window, {
title: 'World Chooser',
width: 318,
height: 250,
layout: 'border',
initComponent: function() {
this.items = [
{
xtype: 'grid',
title: 'Double click to go to a world....',
store: 'WorldsListData',
width: 304,
region: 'center',
height: 164,
columns: [
{
xtype: 'gridcolumn',
header: '',
sortable: true,
resizable: true,
width: 300,
dataIndex: 'worldname',
id: 'WorldName'
}
]
}
];
this.bbar = {
xtype: 'toolbar',
items: [
{
xtype: 'button',
text: 'Create World',
allowDepress: true,
ref: '../createWorldButton'
},
{
xtype: 'button',
text: 'Delete World',
autoWidth: true,
allowDepress: true,
ref: '../createWorldButton'
}
]
};
WorldChooserUi.superclass.initComponent.call(this);
}
});
This is the generated DataStore code:
WorldsListData = Ext.extend(Ext.data.ArrayStore, {
constructor: function(cfg) {
cfg = cfg || {};
WorldsListData.superclass.constructor.call(this, Ext.apply({
storeId: 'WorldsListData',
autoSave: false,
fields: [
{
name: 'worldname'
}
]
}, cfg));
}
});