Apr 17, 2012, 2:26 PM
[CLOSED] Loop through filters Gridpanel
Hi,
I've updated from SVN (about time.. :) ) , but now this piece of Javascript (which worked) gives no result anymore for the filters:
The problem is looping through the filters
Any Idea ? It still works on production (which hasn't the latest DLL's)
Martin
I've updated from SVN (about time.. :) ) , but now this piece of Javascript (which worked) gives no result anymore for the filters:
var getSettings = function() {
var settings = {
sortState: { },
columns: [],
groupField: "",
filter: []
};
var cm = gridPanel.getColumnModel();
for ( var i = 0, len = cm.config.length; i < len; i++ ) {
settings.columns.push( { dataIndex: cm.getDataIndex( i ), width: cm.getColumnWidth( i ), hidden: cm.isHidden( i ) || false } );
}
settings.sortState = gridPanel.store.getSortState() || { field: "", direction: "" };
settings.groupField = gridPanel.store.groupField || "";
gridPanel.getFilterPlugin().filters.each( function( f ) {
alert( f.dataIndex );
if ( f.active ) {
settings.filter.push( { field: f.dataIndex, args: f.serialize() } );
}
} );
Hidden.setValue( Ext.encode( { settings: [settings] } ) ); // <--- EXT.NET.HIDDEN
};
Its difficult to send all the code, but this is the issue. I'm using the code to save the settings of my filters and use the filters in a query.The problem is looping through the filters
Any Idea ? It still works on production (which hasn't the latest DLL's)
Martin
Last edited by Daniil; Apr 25, 2012 at 10:06 PM.
Reason: [CLOSED]