PDA

View Full Version : Store object is not loaded completely after paginates the paging comboBox



tdteti_
14 Oct 2009, 12:45 AM
I have created a new paging comboBox...Initially, (the first search to wich I do) it is working due to the 'store' object has all the values loaded (16 values). The problem is that after paginates, the search is only working if I do it over the current page (to wich loaded on the 'store' object). It means that after paginate, if I search a value placed on other page to which is not the current page, the search it not working (the value is not shown) :(. There is something wrong on my code. Could someone help me? Thanks in advance for your help!!

For further information, this is the code:
Ext.onReady(function(){
// These will be the data to be shown on the comboBox... (dataList_productsListStructure)
var countries = [
['AFG','AFGANISTAN'],
['BDI','BURUNDI'],
['CAN','CANADA'],
['DEU','GERMANY'],
['ECU','ECUADOR'],

['ESP','SPAIN'],
['FIN','FINLAND'],
['GBR','UNITED KINGDOM'],
['HKG','HONG-KONG'],
['IND','INDONESIA'],

['JAM','JAMAICA'],
['MAC','MACAU'],
['MAD','MADAGASCAR'],
['MAL','MALDIVES ISLANDS'],
['MAI','MALI'],

['MAT','MALTA']
];

// 'Reader' object definition...
var readerObject = new Ext.data.ArrayReader(
{}, [
{name: 'country_Code',type:'string'},
{name: 'country_Description',type:'string'}
]
);

// 'Proxy' object definition...
var proxyObject = new Ext.ux.data.PagingMemoryProxy(countries,{});

// 'Store' object definition... (store_productsListStructure)
var storeObject =new Ext.data.Store({
proxy: proxyObject,
data: countries,
reader: readerObject
});

// Custom rendering Template
var rowFormat = new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'<span>{country_Description}</span>',
'</div></tpl>'
);


// Creating the comboBox...
var comboSearch = new Ext.form.ComboBox({
store: storeObject,
triggerAction: 'all',
displayField:'country_Description',
loadingText: 'Searching...',
emptyText: 'Select...',
typeAhead: false,
width: 200,
pageSize:5,
hideTrigger: true,
mode: 'local',
tpl: rowFormat,
applyTo: 'search_ComboBox',
itemSelector: 'div.search-item',
triggerAction:'all'
});
});