Hi Support
Back in 2016, I asked the same question: https://www.telerik.com/forums/grid-setoptions-error-custom-commands-should-have-name-specified (but must have solvedtheissueanotherway).
Now, I have the same requirement (to persist the state of a grid: https://demos.telerik.com/kendo-ui/grid/persist-state)
Using Kendo UI v2021.3.1216, I still get the same error when I call grid.setOptions: "Custom commands should have name specified".
I have changed the "Persist state" grid demo (https://demos.telerik.com/kendo-ui/grid/persist-state) by just adding the following code to the grid setup:
toolbar: [
{ template: kendo.template($("#toolbar-template").html()) }
],
The toolbar template is simply:
<script id="toolbar-template" type="text/x-kendo-template">
x
</script>
The dojo: https://dojo.telerik.com/@mortenma71/EgoYILeS/2
It seems that the persisting grid state with a toolbar template is not possible. The saved options has an empty toolbar (see screenshot)
Could you help?
Thanks.
/Morten
turns out:
This works:
$("#grid").kendoGrid({
toolbar: "toolbar inline",
...
This does not work:
<script id="toolbar-template" type="text/x-kendo-template">toolbar from template
</script>
$("#grid").kendoGrid({
toolbar: [ { template: window.kendo.template($("#toolbar-template").html()) } ],
...