Custom GridToolbarItem with template

3 posts, 0 answers
  1. Alessio
    Alessio avatar
    9 posts
    Member since:
    Aug 2016

    Posted 24 Mar Link to this post

     

    I have this code : 

    $myToolBar = new \Kendo\UI\GridToolbarItem();
    $myToolBar->text("Test ..");
    $myToolBar->template('cust_toolbar');

     

    $grid->addColumn($field1, $field2, $field3, $field4, $command)
         ->dataSource($dataSource)
         ->addToolbarItem($myToolBar)

          .....

          .....

    and this template : 

    <script id='cust_toolbar' type='text/x-kendo-template'>
        <a class="k-button k-button-icontext k-grid-add k-cust-add"><span class="k-icon k-add"></span>Add</a>
        <a class="k-button k-button-icontext k-grid-save k-cust-save k-state-selected"><span class="k-icon k-save"></span>Save</a>
        <a class="k-button k-button-icontext k-grid-update k-cust-update k-state-selected"><span class="k-icon k-update"></span>Update</a>
        <a class="k-button k-button-icontext k-grid-cancel k-cust-cancel k-state-selected"><span class="k-icon k-cancel"></span>Cancel</a>
        <a class="k-button k-button-icontext k-grid-edit k-cust-edit"><span class="k-icon k-edit"></span>Edit</a>
        <a class="k-button k-button-icontext k-grid-delete k-cust-delete"><span class="k-icon k-delete"></span>Delete</a>
    </script>

    But nothing is displayed on grid, what is wrokg ? 

     

    Thanks

     

     

     

  2. Alessio
    Alessio avatar
    9 posts
    Member since:
    Aug 2016

    Posted 24 Mar in reply to Alessio Link to this post

    Ok, is a templateID->  not template->

    would be nice to see that other property with some example on documentation too

    Regards

  3. Stefan
    Admin
    Stefan avatar
    1147 posts

    Posted 28 Mar Link to this post

    Hello Alessio,

    The ToolBar template implementation can be observed in the following example:

    http://demos.telerik.com/php-ui/grid/toolbar-template

    Thank you for the feedback on the documentation, we try to improve the Kendo UI documentation as much as possible in order to make it useful and easy to use.

    Regards,
    Stefan
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top