On my UI, I've a grid where I'm applying filters on columns and getting filtered data. In my REST request, my UI is sending filter as a key:value like this:
filter:[{"operator":"gt","value":222,"property":"qty_raw"}]
and, I want to extract the same filter data from the same grid (using ComponentQuery) so that I can send the same filter/filters(more than one column) in another request on a button click handler, I am writing code in EXTJS like this,
var gridObj = Ext.ComponentQuery.query('myGridId')[0];
var filters = gridObj.store.getFilters();
console.log("print filters.....",filters);
filters in Chrome tool looks like the following snapshot, where the data which I need is in items and map, but I can't reach to the data. I don't know if there is any better way to do this? any suggestions?
Update: I tried doing it using store lastOptions property, it still not working (Error: Uncaught TypeError: Cannot read property 'params' of undefined)
var gridObj = Ext.ComponentQuery.query('Grid_xx')[0];
var lastOptions = gridObj.store.lastOptions,
lastParams = Ext.clone(lastOptions.params);
lastParams.limit = limit; //;var limit = gridObj.store.getTotalCount();
lastParams.page = page; // var page = 1
lastParams.start = start; // var start= 1
lastParams.columnsNameArray = JSON.stringify(columnsNameArray);
console.log("columnArray............ =",lastParams.columnsNameArray);
var encodedFilename = Ext.urlEncode(lastParams);
Ext.create('Ext.Component', {
renderTo: Ext.getBody(),
//url: EfwSlamUI.Config.restUrl.GridExport,
cls: 'x-hidden',
params: lastParams,
autoEl: {
tag: 'iframe',
src: Abc.Config.restUrl.GridExport + '?' + encodedFilename}
});