PDA

View Full Version : Question for change the Store params?



liqingzhu
16 Jan 2013, 8:50 PM
showFlowTrackingById:function(id){
var aview = new ysu.view.TrackingList();
var nav = this.getNav();
nav.parent.setActiveItem(aview);
var store = Ext.getStore('FlowTrackingStore'), panel = aview.getParent(),
proxy = {
type : 'ajax',
url : 'http://127.0.0.1/workflowmobile/back/workflow/findtracking.jspx',
pageParam : 'pageNo',
limitParam : 'pageSize',
extraParams : {
Invok : 'moreList',
limit:5,
docid : id
},
reader : {
type : 'json',
rootProperty : 'newList',
totalProperty : 'totalCount'
},
autoLoad : false
};
var type = window.localStorage.getItem("screen");
store.setProxy(proxy);
store.setProxy({_start:0});
try {
store.removeAll();
panel.setMasked({
xtype : 'loadmask',
message : '?????'
});
var pageflag = false;
// console.log(store.getProxy());
var i = 0;
alert('first loadlist by id ');
store.on('beforeload',function(s,operation){
alert("i==>"+i);
if(i==0){
operation._start = 0;
}
i++;
// operation._start = 0;
});


store.load();
store.sync();
} catch (e) {
panel.setMasked(false);
}
setTimeout(function(){panel.setMasked(false);}, 2000);

},


I create this function which named showFlowTrackingById by a address is like this
“http://127.0.0.1/workflowmobile/mobile/index.html#flowtracking/4CE82AC4A6718E3D41A983E3F4574C33”

It is a routes address directed the showFlowTrackingById function?

But when I pressed the Back Button go back to the main list to get another ID
I found the List store‘s start param does not go to Zero?it still calculated form the old number? Therefore I got start param at sever side is wrong?

Would you help me please?
41331

mitchellsimoens
18 Jan 2013, 9:45 AM
store.loadPage(1)

That will load the first page and change the paging params