Вопрос

I have a GridPanel whose columns have 'items' property set to an Ext.form.field.Trigger. I use the trigger field to work like a filter. I have a button in toolbar which should show/hide the Triggers. For this I need to get the 'items' configuration of the Column. Any ideas?

Code

{
xtype: 'gridcolumn',
dataIndex: 'title',                                     
minWidth:100,
flex: 3,
text: 'Title',
layout: 'hbox',
items:[{
    xtype: 'trigger',
    autoSearch: false,
    anyMatch : true
}]

}

Это было полезно?

Решение 2

I have found a solution for it. Although not the best but gets the job done

Code

var columns = grid.columns;
if(grid.columns!=undefined){
     for(var i =1; i<columns.length; i++){
        var column = columns[i];
        if(column!=undefined){
            var colItems = column.items;                                                                            
            if(colItems!=undefined){
                var colItem = colItems.items[0];                                    
                if(colItem!=undefined){colItem.setVisible(true);}                                               
            }           
        }                                       
    }                                       
}

Другие советы

I guess u should use ID or itemid in ur controls to get their value where ever u want. Additionally to create filters you can execute createFilters on the filter feature if u r not getting desired output.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top