PDA

View Full Version : After window gets open and closed gridfilter gets set to default



pllee
15 Jan 2010, 6:11 AM
Hello,

I have a widow with a filterable grid inside of it and all the list filters work fine when I open it initially but if I close it and open it again the list filters change to default string filters.

I am wondering if this may be a bug in my code or in extJS or some type of non-OO part of Javascript. I don't know if it will help but here is part my code it's an extension of the desktop sample.

Thanks in advance.



var filters = new Ext.ux.grid.GridFilters({
local: true,

filters: [{
type: 'string',
dataIndex: 'name'//,
//disabled: true
}, {
type: 'numeric',
dataIndex: 'Timespent'
}, {
type: 'list',
dataIndex: 'Story_Val',
options: ['01','02','03','05','08','13','21','34']

},{/*
type: 'string',
dataIndex: 'name',
disabled: true*/

type: 'list',
dataIndex: 'Vname',
options: ['2010.1.0-Iteration-02']

}, {
type: 'numeric',
dataIndex: 'Ratio'
}]
});



MyDesktop.Story_Grid = Ext.extend(Ext.app.Module, {
id:'story-grid',
init : function(){
this.launcher = {
text: 'Story-Point-Data',
iconCls:'icon-grid',
handler : this.createWindow,
scope: this
}
},

createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('story-grid');
if(!win){
win = desktop.createWindow({
id: 'story-grid',
title: 'Story-Point-Data',
width:350,
height:600,
iconCls: 'icon-grid',
shim:false,
animCollapse:false,
constrainHeader:true,

layout: 'fit',
items: new Ext.grid.GridPanel({
//id:'story-grid',
store: Storygridstore,
columns: [
{ header: "Pkey", width: 160, sortable: true, renderer:colChange, dataIndex: 'name' },
{ header: "Time_Spent", width: 100, sortable: true, dataIndex: 'Timespent', filter: { type: 'numeric'} },
{ header: "Story", width: 60, sortable: true, dataIndex: 'Story_Val', filterable: true },
{ header: "Vname", width: 300, sortable: true, dataIndex: 'Vname' ,filterable:true },
{ header: "Ratio", width: 100, sortable: true, renderer:RatioChange ,dataIndex: 'Ratio', filterable: true }
],
stripeRows: true,
plugins: [filters],
height: 400,
tbar: [
{ text: 'Clear Filter Data',
iconcls:'silk-delete',
handler: function () {
grid.filters.clearFilters();
} }],
viewConfig: {
forceFit:true
}


})
});
}
win.show();
}
});