Georgioa
10 Aug 2009, 7:43 AM
Hi !
I'm trying to do a dynamic GridPanel based on Erhan's : http://extjs.com/forum/showthread.php?t=58493
I want to use a DirectStore to have only an api configuration to my extension.
So the question is : How can I load metaData + Data from my server and get them to configure my store?
I tried this :
var rdg = new RemoteDataGrid({
ds:new Ext.data.DirectStore({
api:{
read : DataGridControler.loadData
},
fields:[]
})
});
My DataGridControler.loadData returns something like :
{"result":[{
"metaData":{
"totalProperty":"total",
"root":"records",
"id":"id",
"fields":[{"name":"colonne1","type":"string"}],
"sortInfo":{}
}
"success":true,
"total":2,
"records":[{"colonne1":"Test1"}],
"columns":[{
"id":"colonne1",
"hidden":"false",
"dataIndex":"colonne1",
"header":"colonne1"
}]
}],
"tid":2,"action":"DataGridControler","method":"loadData","type":"rpc"}
The problem is that metachange event and load event are not fired. So I can't do anything when I get my object back from the server.
Can I change my meta using DirectStore in this way?
I'm trying to do a dynamic GridPanel based on Erhan's : http://extjs.com/forum/showthread.php?t=58493
I want to use a DirectStore to have only an api configuration to my extension.
So the question is : How can I load metaData + Data from my server and get them to configure my store?
I tried this :
var rdg = new RemoteDataGrid({
ds:new Ext.data.DirectStore({
api:{
read : DataGridControler.loadData
},
fields:[]
})
});
My DataGridControler.loadData returns something like :
{"result":[{
"metaData":{
"totalProperty":"total",
"root":"records",
"id":"id",
"fields":[{"name":"colonne1","type":"string"}],
"sortInfo":{}
}
"success":true,
"total":2,
"records":[{"colonne1":"Test1"}],
"columns":[{
"id":"colonne1",
"hidden":"false",
"dataIndex":"colonne1",
"header":"colonne1"
}]
}],
"tid":2,"action":"DataGridControler","method":"loadData","type":"rpc"}
The problem is that metachange event and load event are not fired. So I can't do anything when I get my object back from the server.
Can I change my meta using DirectStore in this way?