PDA

View Full Version : Help with gridpanel



sam709
17 Feb 2010, 7:37 PM
HI,

I am using the desktop gridpanel in the desktop extjs example. I need help in order to get my code to work. Clients should join the gridpanel after a http request which is then sent to sql which is interpreted by a php script then sent back with ajax. I am trying to process how to remove the client's row on a disconnect, or edit it if the status changes.


if (status_node[0].firstChild.nodeValue == 'delete')
{
//REMOVE client?
}
else
{
MyRecordType = Ext.data.Record.create(['IP', 'msg','status','Country','[email protected]'],"1");
myrec = new MyRecordType({"IP":IP_node[0].firstChild.nodeValue, "msg":msg_node[0].firstChild.nodeValue,"status":status_node[0].firstChild.nodeValue,"Country":country_node[0].firstChild.nodeValue,"[email protected]":pcuser_node[0].firstChild.nodeValue});
store.add(myrec);
}

If it helps, this my store is created with blank data:


Ext.grid.dummyData = [

];

var store = new Ext.data.Store({
reader: new Ext.data.ArrayReader({}, [
{name: 'IP'},
{name: 'msg',},
{name: 'status'},
{name: 'Country'},
{name: '[email protected]'}
]),
data: Ext.grid.dummyData
});

It adds correctly but cannot figure out the rest. Maybe I am overlooking something?

Thanks,
Sam