This is a migrated thread and some comments may be shown as answers.

Add create button in grid toolbar template

1 Answer 345 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Winston
Top achievements
Rank 1
Winston asked on 04 Nov 2012, 07:07 AM
I would like to implement a template in the grid toolbar. I am just not sure how to add the "Add a new record" button that will call the
.ToolBar(toolbar => toolbar.Create().Text("Create"))

I am NOT using .NET so I will get an error Uncaught SyntaxError: Unexpected token >

Please see my template code in the jsbin below.

http://jsbin.com/ojevoc/23/edit

1 Answer, 1 is accepted

Sort by
0
Accepted
OnaBai
Top achievements
Rank 2
answered on 04 Nov 2012, 09:23 AM
Since you are invoking a "customFunc" on click, you should define it something like:

function customFunc() {
  $("#grid").data("kendoGrid").addRow();
}

But before that you should define ShipAddress in your model otherwise create will fail.

Tags
Grid
Asked by
Winston
Top achievements
Rank 1
Answers by
OnaBai
Top achievements
Rank 2
Share this question
or