Reputation: 11642
I have simple kendo grid.
I would like to trigger create, save, etc buttons with external buttons outside of the grid columns.
See image for more informations.
How can i do it in Kendo Grid please?
Thanks for any advice.
Upvotes: 3
Views: 4909
Reputation: 75
You can trigger adding a new line to a kendo grid with a button using a clickfunction:
<a class="btn btn-primary" id="yourButtonId"></a>
And then simply:
<script type="text/javascript">
$(document).ready(function ()
{
var grid = $("#yourGridNameHere").data("kendoGrid");
$("#yourButtonId").click(function () {
grid.addRow();
})
}
</script>
Upvotes: 5
Reputation: 8020
Try like this, For Add new item in grid,
$('#btnAddCard').on('click', function () {
$('.k-grid-add').trigger('click');
});
Upvotes: 3