Why does the click handler for this ExtJS action column not work? -
i created action column icon, , want hide icon if row being clicked eval license.but click event handler not getting called?
xtype: 'actioncolumn', text: 'actions', align: 'center', width: 110, listeners: [{ gettip: function (v, metadata, rec, row, col, store) { return 'delete ' + rec.get('licenseid'); }, click: function (grid, rowindex, colindex, item, event, record, row) { alert('here'); this.fireevent('licenseiconclick', grid, record, 'delete'); } }], renderer: function(value, metadata, record){ if(record.get('licenseid') == 'atlas_usx_evaluation') { return "<img src='./images/atlas/icons/blue/settings-close-b.png'>"; } }
action column not have , therefore not fire click event.
use handler function , getclass instead
xtype:'actioncolumn', width:50, items: [{ tooltip: 'edit', handler: function(grid, rowindex, colindex) { var rec = grid.getstore().getat(rowindex); alert("edit " + rec.get('firstname')); this.fireevent('licenseiconclick', grid, record, 'delete'); //grid.dolayout(); //maybe... i'm not sure if necessary }, getclass: function(v, meta, rec) { if (record.get('licenseid') == 'atlas_usx_evaluation') { return 'settingclosea'; } else { return 'settingcloseb'; } } }] css classes
.x-action-col-cell img.settingclosea { background-image: url("./images/atlas/icons/blue/settings-close-a.png"); } .x-action-col-cell img.settingcloseb { background-image: url("./images/atlas/icons/blue/settings-close-b.png"); } with getclass can dynamically apply css class icon want. in handler function can fire event.
Comments
Post a Comment