PDA

View Full Version : set TotalProperty dynamically



funfan34
31 May 2009, 9:03 PM
I have a grid, which allows add/remove of records. When the grid is first loaded, totalProperty value is displayed correctly. When grid is updated (add/remove record), totalProperty value is not updated:



// my data store
ds = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(dataObject),
reader: new Ext.data.JsonReader({root:'documentBeanList',totalProperty:'totalDocumentCount'}, [
{name: 'username'},
{name:'userAddress'},
{name: 'DOB'}

])
});

//my grid
userGrid = new Ext.GridPanel({
store: ds,
cm: colModel,
selModel: csm,
tbar: new Pavo.Toolbar ({
pageSize:5
...
....
});

//After adding/removing record, i reload the grid as :

var proxyURL = new Ext.data.HttpProxy({url: url, method:'post'});
var gridSource = userGrid.getStore();
gridSource .proxy = proxyURL ;
gridSource .meta.totalProperty=varLastetCount // a variable of latest count.
gridSource .reload();


The grid is reloaded with the latest record, but totalProperty is not displaying the latest count. please help. thanks

5 Jun 2009, 3:14 PM
is the totalDocumentCount being resent by the server??

5 Jun 2009, 3:15 PM
Why go from a memory proxy to a http proxy.