In example of 1.1 and 2.0, under examples/form/custom.html
there is a nice searchable grid, it great a customized search box but when I try to test and use it, it has the following issue,
#1 initially it return all pages
#2 search (for example 'ajax') return limited pages,
#3 but when I using the pagingToolbar to page it, it return to the full search,
I study and got a little adjustment like this
From
PHP Code:
onTrigger1Click : function(){
if(this.hasSearch){
var o = {start: 0};
o[this.paramName] = '';
this.store.reload({params:o});
this.el.dom.value = '';
this.triggers[0].hide();
this.hasSearch = false;
}
},
onTrigger2Click : function(){
var v = this.getRawValue();
if(v.length < 1){
this.onTrigger1Click();
return;
}
var o = {start: 0};
o[this.paramName] = v;
this.store.reload({params:o});
this.hasSearch = true;
this.triggers[0].show();
}
To
PHP Code:
onTrigger1Click : function(){
if(this.hasSearch){
var o = {start: 0};
o[this.paramName] = '';
this.store.baseParams[this.paramName] = '';
//this.store.reload({params:o});
this.store.reload();
this.el.dom.value = '';
this.triggers[0].hide();
this.hasSearch = false;
}
},
onTrigger2Click : function(){
var v = this.getRawValue();
if(v.length < 1){
this.onTrigger1Click();
return;
}
var o = {start: 0};
o[this.paramName] = v;
this.store.baseParams[this.paramName] = v;
this.store.reload();
this.hasSearch = true;
this.triggers[0].show();
}
Maybe have better ways, but this workable, hope can be helpfully.
This can be apply to 2.0 dev version as well, thanks