PDA

View Full Version : Wrong paination .



sachin sachdeva
25 Apr 2011, 3:18 AM
Hi.... i have a combo box with paging toolbar ..Now my requirement is i want to show the exact figure of the paging toolbar of combo in a paging toolbar of grid .....the code i am using is given below.


COMBO BOX CODE
var search = new Ext.form.ComboBox({
store : GlobalSearchDataStore,
mode : 'remote',
displayField : 'fileName',
id : 'searchclrid',
typeAhead : false,
loadingText : 'Searching...',
width : 370,
pageSize : 10,
minLength : 0, // 5
maxLength : 250,
hideTrigger : true,
tpl : resultTpl,
emptyText : 'Enter minimum 3 characters...',
applyTo : 'search',
queryParam : 'searchKeyword',
itemSelector : 'div.search-item',
nocache : false,
minChars : 3,
validateOnBlur : true,
enableKeyEvents : true,
listeners : {
blur : function() {
Ext
.getCmp("searchclrid")
.setValue("Enter minimum 3 characters...");
},
focus : function() {
Ext.getCmp("searchclrid").clearValue();

},


keypress : function(comboBox, e) {
if (e.getCharCode() == e.ENTER) {

EnterKey();//---here i need to show combobx paging toolbar into grid.Enter code is written below.
}
}
}

STORE

GlobalSearchDataStore = new Ext.data.Store({
// load using script tags for cross domain
proxy : new Ext.data.HttpProxy({
url : 'searchUsingKeyword.jsp',
method : 'POST'
}),
reader : GlobalSearchReader
});




Function that acivates on enter key.......
function EnterKey() {
mainTabPanel.activate(0);
grid.getBottomToolbar().bind(GlobalSearchDataStore);
grid.reconfigure(GlobalSearchDataStore, columnModel);
};



Now this code is working fine but the paging of the grid paging toolbar always starts from the first even if we press enter from second page in combobox....u can see the attached screen shot.