AtulDawkhare
23 Jan 2012, 4:53 AM
Hi
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,
items:
[
{
icon : 'images/new/icon/edit.png',
handler: function(grid, rowIndex, colIndex)
{
var rec = grid.getStore().getAt(rowIndex);
grid.getStore().getAt(rowIndex).set('closed', 1);
grid.addRowCls(grid.getNode(rowIndex),'line-through');
var rec = Store.getAt(rowIndex);
rowEditing.cancelEdit();
rowEditing.startEdit(rec, 0);},
style:'margin-left:5px',
getClass: function(value,metadata,record)
{
var closed = record.get('closed');
if (closed == 1 )
{
return 'x-hide-display';
}
else
{
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);
delete(parent,idx);
}
}
]
}
Now as the row editor is enabled , user has ONLY 2 options
1] click on update
2] click on cancel
30897
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?
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,
items:
[
{
icon : 'images/new/icon/edit.png',
handler: function(grid, rowIndex, colIndex)
{
var rec = grid.getStore().getAt(rowIndex);
grid.getStore().getAt(rowIndex).set('closed', 1);
grid.addRowCls(grid.getNode(rowIndex),'line-through');
var rec = Store.getAt(rowIndex);
rowEditing.cancelEdit();
rowEditing.startEdit(rec, 0);},
style:'margin-left:5px',
getClass: function(value,metadata,record)
{
var closed = record.get('closed');
if (closed == 1 )
{
return 'x-hide-display';
}
else
{
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);
delete(parent,idx);
}
}
]
}
Now as the row editor is enabled , user has ONLY 2 options
1] click on update
2] click on cancel
30897
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?