Place A Delete Action Link In A Table Row In JEasyUI DataGrid
Posted by blogmeister on
January 21, 2013

To add an action similar to the image (edit, delete, save, cancel) above, add this table header tag within the table row tag.
|
1 |
<th width="100">Action</th> |
Now, in order for delete links to appear, you need to add a custom made Javascript function that has parameters ‘value, row and index’ and returns a string that dynamically creates an HTML hyperlink for the delete functionality.
|
1 2 3 |
function formatAction(value, row, index){ return '<a href="//" onclick="deleteRow(' + index + ')>Delete</a>'; } |
Lastly, you create another custom made function so that when the delete hyperlink is clicked, that function is called.
|
1 2 3 |
function deleteRow(index) { alert('Row ' + index + ' was clicked'); } |











2 Responses to “Place A Delete Action Link In A Table Row In JEasyUI DataGrid”
Dear friend, could you please send me your example please to see how this work???
One additional question, if i need to use just one linkbutton, what i must to do?
By VIctor on Jan 23, 2013
@victor: please check jeasyui’s datagrid sample code. they have all the source code samples there
By admin on Jan 23, 2013