How to implement a toolbar
How to implement a toolbar
Hello
I love the simplicity of DataTables to create powerful grids. One thing that I however feel is lacking is the support of a toolbar (similar to what Flexigrid offers: http://www.flexigrid.info/). This would come in handy to nicely place a "Create" and "Delete" (maybe even "Edit") action icons in the footer of the grid.
Is there already a workaround to implement such action icons or would a toolbar we a new feature request?
Thanks
I love the simplicity of DataTables to create powerful grids. One thing that I however feel is lacking is the support of a toolbar (similar to what Flexigrid offers: http://www.flexigrid.info/). This would come in handy to nicely place a "Create" and "Delete" (maybe even "Edit") action icons in the footer of the grid.
Is there already a workaround to implement such action icons or would a toolbar we a new feature request?
Thanks
This discussion has been closed.
Replies
Is it correct to state that this solves the issue as long as the first column is wide enough to contain all the toolbar icons?
If you wanted to take it a step further, you and use the plug-in API to define your own 'character' element for sDom, which will place your toolbar where ever you want: http://datatables.net/development/features :-)
Regards,
Allan
[code]
$(document).ready(function() {
$('#yields').dataTable({
"aoColumns": [
null,
null,
{ "bSortable": false, "bSearchable": false, "sWidth": '80px' }
],
"bStateSave": true,
"bLengthChange": false,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<"H"<"toolbar">lfr>t<"F"ip>' // add custom div for toolbar
});
// attach toolbar
$("div.toolbar").replaceWith('Add');
// handle toobar events
$('#add').click(function() {
window.location.href = "<%= Url.Action("Create") %>";
});
});
[/code]
Regards,
Allan
Thanks
Hi all