software_Engineer
5 Dec 2011, 8:40 AM
Hi all,
I've a little bit problem with this code (I'm using extjs 3.2.1) :
var groupStore = new Ext.data.JsonStore({
baseParams: '',
method: 'POST',
url: 'http://127.0.0.1/index.php/ctrlpanel/getGroups;',
root: 'results',
fields: [ 'gid', 'groupname', 'accesslevel', 'groupdesc' ],
});
var groupGrid = new Ext.grid.GridPanel({
store: groupStore,
selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
loadMask: true,
border: false,
autoload: true,
columns: [
new Ext.grid.RowNumberer(),
{ id: 'gid', header: "GID", dataIndex: 'gid', width: 25 },
{ header: "Name", dataIndex: 'groupname'/*, width: '40%'*/ },
{ header: "AccessLevel", dataIndex: 'accesslevel', /*width: '60%',*/ menuDisabled: true },
{ id: 'description-col', header: "Description", dataIndex: 'groupdesc', /*width: '60%',*/ menuDisabled: true }
],
defaults: {
sortable: true,
menuDisabled: false
},
viewConfig: {
forceFit:true
},
});
I think the problem is that I don't display any data because I don't call groupGrid.load() . But other examples I saw the groupGrid.load() called first of groupGrid in onReady() method i.e.:
groupStore.load();
var groupGrid = new Ext.grid.GridPanel({
....
)}
but I have to call groupStore.load() inside groupGrid = new Ext.grid.GridPanel({.. HERE..});
how can i do ?
I've a little bit problem with this code (I'm using extjs 3.2.1) :
var groupStore = new Ext.data.JsonStore({
baseParams: '',
method: 'POST',
url: 'http://127.0.0.1/index.php/ctrlpanel/getGroups;',
root: 'results',
fields: [ 'gid', 'groupname', 'accesslevel', 'groupdesc' ],
});
var groupGrid = new Ext.grid.GridPanel({
store: groupStore,
selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
loadMask: true,
border: false,
autoload: true,
columns: [
new Ext.grid.RowNumberer(),
{ id: 'gid', header: "GID", dataIndex: 'gid', width: 25 },
{ header: "Name", dataIndex: 'groupname'/*, width: '40%'*/ },
{ header: "AccessLevel", dataIndex: 'accesslevel', /*width: '60%',*/ menuDisabled: true },
{ id: 'description-col', header: "Description", dataIndex: 'groupdesc', /*width: '60%',*/ menuDisabled: true }
],
defaults: {
sortable: true,
menuDisabled: false
},
viewConfig: {
forceFit:true
},
});
I think the problem is that I don't display any data because I don't call groupGrid.load() . But other examples I saw the groupGrid.load() called first of groupGrid in onReady() method i.e.:
groupStore.load();
var groupGrid = new Ext.grid.GridPanel({
....
)}
but I have to call groupStore.load() inside groupGrid = new Ext.grid.GridPanel({.. HERE..});
how can i do ?