You can use something like this:
http://extjs.com/forum/showthread.php?t=32692
as input field for the filter.
Code:...
filter:
{
xtype: "lovcombo",
triggerAction: "all",
mode: "local",
store: [[1,'A'],[2,'B'],[3,'C']]
}
...
Printable View
You can use something like this:
http://extjs.com/forum/showthread.php?t=32692
as input field for the filter.
Code:...
filter:
{
xtype: "lovcombo",
triggerAction: "all",
mode: "local",
store: [[1,'A'],[2,'B'],[3,'C']]
}
...
Hi, our filters disappear as well when we move the columns around. Is there any way to reload the filters? Thanks! Below is an example of the code we use to move the columns and then the filters disappear...
Code:var views = {
defaultView:
['id','ordername','ordertype','joblabel','companyname','contactfullname','salesfullname','orderstate','orderstage','orderstatus','lastupdated','total']
,
jobDetails:
['id','ordername','ordertype','joblabel','jobshipaddress1','jobshipcity','jobshipstateabbrev','jobshipzipcode','companyname','contactfullname','salesfullname','orderstate','orderstage','orderstatus','lastupdated','total']
}
var cm = orderhomeGrid.getColumnModel();
//iterate through defined view columns, moving and showing the desired cols in the right order
for (var i=0; i<view.length; i++)
{
//start at col 1 so that checkbox are always included and are first
var idx = cm.getIndexById(view[i]);
if (idx == -1){
firebugLog("Invalid column id in grid view definition: " + view[i]);
continue;
}
cm.moveColumn(idx, i+1);
cm.setHidden(i+1, false);
}
//now hide the rest of the columns
for (var i=view.length+1; i<cm.getColumnCount()-1; i++)
{
cm.setHidden(i, true);
}
Thanks, that worked! Now I'm having a similar issue when I resize a column. The column in question resizes fine, but the other columns do not resize. I then tried calling the onRender after a resize but all of the columns resize in width but they grow in height two-fold, each time a column resize occurs?
Have you seen an instance where the fields are missing in the header?
I just added the plug-in to a standard grid and the grid works fine, but the header doesn't contain any input fields.
Thanks for the help.
-John
Nevermind - very easy to figure out - I didn't have any filters attached to the columns - after looking at the source I realized they weren't created on the fly. :))
I would like to show or hide the filters on demand from a button. Do you have a code example on how to show and hide the filters on demand? Thanks!
I figured it out... This worked for me:
Code:this.grid.toggleHeaderFilters = function(bShow)
{
if(!this.headerFilters)
return;
if(arguments.length == 0)
var bShow = true;
for(var hc in this.headerFilters.headerCells)
{
var headerCell = this.headerFilters.headerCells[hc];
for(var cc in headerCell.children)
{
if (cc>0)
{
var child = headerCell.children[cc];
if (bShow)
{
child.style.height = this.headerFilters.height - (this.headerFilters.padding * 2) + 'px';
}
else
{
child.style.height = '0px';
}
}
}
}
}