PDA

View Full Version : filter giving error



newusername
21 Jul 2014, 4:05 AM
HI ,

I have list filter applied on one of the column and if store has no value for that column then rendering of filter is not so good. I want to remove that rendering how can I do that ?

Please see the attached screen shot of rendering of filter if that column don't have any data to display
I don't want to show either display filter nor that part after you mouse hover on "Filter" label.

49715

Following is the code snippet.


Ext.onReady(function() {


// Define data model and store (with test data) for grid.
Ext.define("Employee", {
extend: "Ext.data.Model",
fields: [ "name", "age", "empid" ]
});
var Restaurants = Ext.create("Ext.data.Store", {
model : "Employee",
data : [
{name : "emp1" , age:15},
{ name : "emp2", age : 20}

]
});


var filters = {
ftype : "filters",
local : true,
autoReload : false
};


// Now build the UI.
new Ext.Viewport({
layout : "fit",
items : [


{ xtype : "grid", store : Restaurants, features : [ filters ],
columns : [
{ width : 150, text : "Name", dataIndex : "name",
filter : { type : "string" }
},
{ width : 100, text : "Age", dataIndex : "age" },
{ width : 50, text : "empId", dataIndex : "empid",
filter : { type : "list"}
}
]
}


]
});


});

mitchellsimoens
29 Jul 2014, 9:53 AM
So if you don't provide data for the list filter, you don't want the menu item that is supposed to show the list values to display?

newusername
30 Jul 2014, 7:18 AM
Yes . That is correct.

newusername
31 Jul 2014, 9:14 PM
Please suggest , what should I do ?