View Full Version : Grid with Edit Delete image , needs to hide after click

23 Jan 2012, 4:53 AM
I have Grid with Row editor. and in the action column I have logic for Edit and Delete the row.

Now my requirement is , when user clicks on Edit image ,

1] image should get hide
2] Row editor should gets enabled.

I am able to achieved this. Here is the code for that

xtype: 'actioncolumn',
width: 80,
icon : 'images/new/icon/edit.png',
handler: function(grid, rowIndex, colIndex)
var rec = grid.getStore().getAt(rowIndex);
grid.getStore().getAt(rowIndex).set('closed', 1);
var rec = Store.getAt(rowIndex);
rowEditing.startEdit(rec, 0);},
getClass: function(value,metadata,record)
var closed = record.get('closed');
if (closed == 1 )
return 'x-hide-display';
return 'x-grid-center-icon';
icon : 'images/new/icon/delete.png',
handler: function(grid, rowIndex, colIndex)
var rec = Store.getAt(rowIndex);
var idx= Store.indexOf(rec);

Now as the row editor is enabled , user has ONLY 2 options
1] click on update
2] click on cancel


My Queries are

1] In both the case I want to enabled the image for that row. [which I have hide/ disabled]
2] I want to know that is it possible to enabled the row editor only on edit image click, rather than clicking on row?

23 Jan 2012, 12:35 PM
I wonder if you can set clicksToEdit to zero and if that would stop the editor from appearing by tapping on the row.

23 Jan 2012, 12:50 PM
the proper way of doing it is listening to the beforeedit event, inspect the column. If it's an action column, then prevent the edit from taking place.

23 Jan 2012, 9:37 PM
Thank you so much for the reply.

It is not working even if I made the clicksToEdit to 0. I guess it will work using the listener, let me try it out

Can you please tell me how can i enabled the image , which I have disabled?

I want to know how can I get Action column when the control is in row editor part.