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

Custom GridToolbarItem with template

2 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alessio
Top achievements
Rank 1
Alessio asked on 24 Mar 2017, 11:16 AM

 

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 Answers, 1 is accepted

Sort by
0
Alessio
Top achievements
Rank 1
answered on 24 Mar 2017, 12:15 PM

Ok, is a templateID->  not template->

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

Regards

0
Stefan
Telerik team
answered on 28 Mar 2017, 08:48 AM
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 (charts) and form elements.
Tags
Grid
Asked by
Alessio
Top achievements
Rank 1
Answers by
Alessio
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or