grid.setOptions error "Custom commands should have name specified"

2 posts, 0 answers
  1. Morten
    Morten avatar
    336 posts
    Member since:
    Jul 2012

    Posted 29 Mar 2016 Link to this post

    When I call grid.setOptions I get the error message "Custom commands should have name specified".

    This is the saved options (localStorage) I try to set:

    {"prefix":"","name":"Grid","columns":[{"encoded":true,"hidden":true,"field":"id","title":"Id","width":90,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"3c3652ad-0b29-4fa3-babb-b34fd703b64d","style":"display:none"}},{"encoded":true,"field":"task","title":"Task","headerAttributes":{"id":"9f9c5a17-e285-4781-9bd6-8a7c2dfd93af"}},{"encoded":true,"hidden":true,"field":"description","title":"Description","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"7e36d3a8-ec2c-4617-b409-5066a88273c7","style":"display:none"}},{"encoded":true,"hidden":true,"field":"files","title":"Files","attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"b10e9159-5a0d-4550-93fd-19c1a8099465","style":"display:none"}},{"encoded":true,"title":"Period (Deadline)","minScreenWidth":768,"headerAttributes":{"id":"ee717db3-5d7a-489a-b0b0-e4db29586ccb"}},{"encoded":true,"hidden":true,"field":"begin","title":"Start","format":"{0:dd-MMM-yyyy}","width":100,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"e2e6910e-41e3-4a0e-b836-2fd0c7bc075e","style":"display:none"}},{"encoded":true,"hidden":true,"field":"end","title":"End","format":"{0:dd-MMM-yyyy}","width":100,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"b1ba8653-8c31-4509-b971-41d12cc4781f","style":"display:none"}},{"encoded":true,"hidden":true,"field":"deadline","title":"Deadline","format":"{0:dd-MMM-yyyy}","width":100,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"6c6fd996-856a-4cd5-873e-854b77c70f06","style":"display:none"}},{"encoded":true,"hidden":true,"field":"category","title":"Category","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"ebfa68db-a58d-4374-8142-b7f00deac354","style":"display:none"}},{"encoded":true,"hidden":true,"field":"storeLocation","title":"Store location","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"cabd1bfd-f059-4746-b2e2-8e1f13b15d20","style":"display:none"}},{"encoded":true,"hidden":true,"field":"checklist","title":"Checklist","filterable":{"multi":true},"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"618147df-a971-4771-bfe6-c3ca64b4cc8b","style":"display:none"}},{"encoded":true,"hidden":true,"field":"manager","title":"Manager","filterable":{"multi":true},"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"43337326-6f60-4669-9068-30116a33de62","style":"display:none"}},{"encoded":true,"hidden":true,"field":"respType","title":"Responsibility","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"3e76bba2-a39a-482f-bc67-89646c93fc31","style":"display:none"}},{"encoded":true,"hidden":true,"field":"purpose","title":"Purpose","filterable":{"multi":true},"width":150,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"0554ea78-d6ff-44a7-996c-d8849a81a7e7","style":"display:none"}},{"encoded":true,"hidden":true,"field":"active","title":"Active","width":90,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"a0947002-b6a6-4501-9bf7-a226ecffcead","style":"display:none"}},{"encoded":true,"hidden":true,"field":"storeCount","title":"Stores","width":90,"attributes":{"style":"display:none"},"footerAttributes":{"style":"display:none"},"headerAttributes":{"id":"95955092-27eb-4ba0-8a80-63366e49711a","style":"display:none"}}],"toolbar":[{}],"autoBind":true,"filterable":true,"scrollable":true,"sortable":true,"selectable":false,"allowCopy":false,"navigatable":false,"pageable":{"refresh":true,"buttonCount":3,"pageSizes":[10,25,50,100],"messages":{"empty":"","display":"{0}-{1} / {2}","itemsPerPage":""}},"editable":false,"groupable":false,"rowTemplate":"","altRowTemplate":"","noRecords":{"template":"<span class='ise-grid-empty'>No data</span>"},"dataSource":{"data":null,"schema":{"model":{"fields":{"id":{"type":"number"},"task":{"type":"string"},"begin":{"type":"date"},"end":{"type":"date"},"deadline":{"type":"date"},"category":{"type":"string"},"storeLocation":{"type":"string"},"checklistId":{"type":"number"},"checklist":{"type":"string"},"completedCount":{"type":"number"},"storeCount":{"type":"number"},"active":{"type":"boolean"},"managerId":{"type":"number"},"manager":{"type":"string"},"respTypeId":{"type":"number"},"respType":{"type":"string"},"respShort":{"type":"string"},"description":{"type":"string"},"purposeId":{"type":"number"},"purpose":{"type":"string"},"isPast":{"type":"boolean"},"isCurrent":{"type":"boolean"},"isFuture":{"type":"boolean"}}}},"offlineStorage":null,"serverSorting":false,"serverPaging":false,"serverFiltering":false,"serverGrouping":false,"serverAggregates":false,"batch":false,"transport":{"read":{"type":"POST","url":"/System/GetTasks","dataType":"json","contentType":"application/json; charset=utf-8"},"dataSource":null},"sort":[{"field":"begin","dir":"asc"}],"pageSize":10,"page":1,"group":[]},"height":null,"resizable":true,"reorderable":false,"columnMenu":{"sortable":false},"detailTemplate":null,"columnResizeHandleWidth":3,"mobile":"","messages":{"editable":{"cancelDelete":"Cancel","confirmation":"Are you sure you want to delete this record?","confirmDelete":"Delete"},"commands":{"create":"Add new record","cancel":"Cancel changes","save":"Save changes","destroy":"Delete","edit":"Edit","update":"Update","canceledit":"Cancel","excel":"Export to Excel","pdf":"Export to PDF"},"noRecords":"No records available."},"excel":{"proxyURL":"","allPages":false,"filterable":false,"fileName":"Export.xlsx"},"pdf":{"fileName":"Export.pdf","proxyURL":"","paperSize":"auto","allPages":false,"landscape":false,"margin":null,"title":null,"author":null,"subject":null,"keywords":null,"creator":"Kendo UI PDF Generator v.2016.1.322","date":null}}

     

     

     

  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 31 Mar 2016 Link to this post

    Hello Morten,

    The error you have described is caused by the toolbar option containing an empty object which is not valid. However, from the provided information is not obvious how this configuration is created nor how to re-create it. Thus, in order to further investigate your case it will be required to provide a small runnable sample in which the issue can be observed in full. You may use this online demo as a base. 

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top