Add create button in grid toolbar template

2 posts, 1 answers
  1. Winston
    Winston avatar
    2 posts
    Member since:
    Oct 2012

    Posted 04 Nov 2012 Link to this post

    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
  2. Answer
    OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 04 Nov 2012 Link to this post

    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.

  3. Kendo UI is VS 2017 Ready
Back to Top