redrom
redrom

Reputation: 11642

Kendo Grid How to Trigger add new row by external button?

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. enter image description here

Upvotes: 3

Views: 4909

Answers (2)

Max Köllmer
Max Köllmer

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

Jaimin
Jaimin

Reputation: 8020

Try like this, For Add new item in grid,

 $('#btnAddCard').on('click', function () {
    $('.k-grid-add').trigger('click');
 });

Upvotes: 3

Related Questions