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

Invalid Template error when using editable grid in hierarchical grid.

5 Answers 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 10 Dec 2012, 10:58 AM
Hello,

I have the following client template:
<script id="questionsTemplate" type="text/kendo-tmpl">
  
    @(Html.Kendo().Grid<AssignedQuestionViewModel>()
          .Name("Questions_#=QuestionGroupTemplateId#")
          .Columns(columns =>
                       {
                           columns.Bound(i => i.QuestionTemplateId).Hidden();
                           columns.Bound(i => i.QuestionGroupTemplateId).Hidden();
                           columns.Bound(i => i.Required);
                           columns.Bound(i => i.QuestionText);
                       }
          )
          .ToolBar(toolBar => toolBar.Save())
          .Editable(editable => editable.Mode(GridEditMode.InCell))
          .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Batch(true)
                                        .ServerOperation(true)
                                        .Model(model =>
                                                   {
                                                       model.Id(m => m.QuestionTemplateId);
                                                       model.Field(m => m.QuestionTemplateId).Editable(false);
                                                       model.Field(m => m.QuestionGroupTemplateId).Editable(false);
                                                   })
                                        .Read(read => read.Action("ReadAssignedQuestions", "QuestionManagement", new { p = "#=QuestionGroupTemplateId"})
                                                          .Type(HttpVerbs.Post)                                                         
                                        )
                                        .Update(update => update.Action("SaveAssignedQuestions", "QuestionManagement"))
          )
          .ToClientTemplate()
          )
        </script>

When the code breaks on the 'Invalid Template Error", Here is what is in the output from the Dynamic Code page in VS2012:

<script id="questionsTemplate" type="text/kendo-tmpl">
  
    <div class="k-widget k-grid" id="Questions_#=QuestionGroupTemplateId#"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-save-changes" href="#"><span class="k-icon k-update"></span>Save changes</a><a class="k-button k-button-icontext k-grid-cancel-changes" href="#"><span class="k-icon k-cancel"></span>Cancel changes</a></div><table cellspacing="0"><colgroup><col /><col /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="QuestionTemplateId" data-title="[en-US: QuestionTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionTemplateId]</span></th><th class="k-header" data-field="QuestionGroupTemplateId" data-title="[en-US: QuestionGroupTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionGroupTemplateId]</span></th><th class="k-header" data-field="Required" data-title="Required" scope="col"><span class="k-link">Required</span></th><th class="k-header" data-field="QuestionText" data-title="Question Text" scope="col"><span class="k-link">Question Text</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="2"></td></tr></tbody></table></div><script>
    jQuery(function(){jQuery("\#Questions_#=QuestionGroupTemplateId#").kendoGrid({"columns":[{"title":"[en-US: QuestionTemplateId]","hidden":true,"field":"QuestionTemplateId","encoded":true},{"title":"[en-US: QuestionGroupTemplateId]","hidden":true,"field":"QuestionGroupTemplateId","encoded":true},{"title":"Required","field":"Required","encoded":true,"editor":"\u003cdiv class=\"baseEditorTemplate\" style=\"\"\u003e\u003cdiv\u003e    \u003c/div\u003e        \u003cdiv\u003e        \u003clabel for=\"Required\" title=\"Required\"\u003eRequired\u003c/label\u003e\u0026nbsp;\u003cinput class=\"checkBoxes\" data-val=\"true\" data-val-required=\"The Required field is required!!.\" id=\"Required\" name=\"Required\" title=\"Required\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"Required\" type=\"hidden\" value=\"false\" /\u003e    \u003c/div\u003e    \u003cdiv id=\"errorMsg\"\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Required\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Required\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"title":"Question Text","field":"QuestionText","encoded":true,"editor":"\u003cdiv class=\"baseEditorTemplate\"\u003e\u003cdiv\u003e    \u003clabel for=\"QuestionText\" title=\"Question Text\"\u003eQuestion Text\u003c/label\u003e\u003c/div\u003e\u003cdiv\u003e\u003cinput class=\"k-textbox\" data-val=\"true\" data-val-required=\"The Question Text field is required!!.\" id=\"QuestionText\" name=\"QuestionText\" title=\"Question Text\" type=\"text\" value=\"\" /\u003e    \u003cdiv id=\"errorMsg\"\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"QuestionText\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e      \u003c/div\u003e\u003c/div\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"QuestionText\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"}],"scrollable":false,"editable":{"confirmation":"Are you sure you want to delete this item?","mode":"incell","template":null,"create":true,"update":true,"destroy":true},"toolbar":{"command":[{"name":null,"buttonType":"ImageAndText"}]},"dataSource":{"transport":{"read":{"url":"/Administration/QuestionManagement/ReadAssignedQuestions/#=QuestionGroupTemplateId","type":"POST"},"update":{"url":"/Administration/QuestionManagement/SaveAssignedQuestions"}},"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-ajax","filter":[],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"QuestionTemplateId","fields":{"QuestionTemplateId":{"editable":false,"type":"number"},"QuestionGroupTemplateId":{"editable":false,"type":"number"},"QuestionText":{"type":"string"},"Required":{"type":"boolean"}}}},"batch":true}});});
<\/script>
        </script>
If I make the template grid 'non editable', it works fine.  Also, if I take the client grid and use it stand-alone, it works fine. It is only when I try to use it as a sub-grid in the hierarchical grid that it fails.

Thanks you!
Danny Green



5 Answers, 1 is accepted

Sort by
0
Software
Top achievements
Rank 1
answered on 10 Dec 2012, 12:59 PM
I did just notice a mistake in the code I posted (I had actually been trying hard-coded values and made this mistake when putting it back to 'normal' to post).  Fixing it does not fix the problem.  the mistake was setting the read.Action 'p' parameter didn't have the closing hash tag.  Here is the corrected code that still does not work, I just didn't want you to get sidetracked by that mistake:


<script id="questionsTemplate" type="text/kendo-tmpl">
  
    @(Html.Kendo().Grid<AssignedQuestionViewModel>()
          .Name("Questions_#=QuestionGroupTemplateId#")
          .Columns(columns =>
                       {
                           columns.Bound(i => i.QuestionTemplateId).Hidden();
                           columns.Bound(i => i.QuestionGroupTemplateId).Hidden();
                           columns.Bound(i => i.Required);
                           columns.Bound(i => i.QuestionText);
                       }
          )
          .ToolBar(toolBar => toolBar.Save())
          .Editable(editable => editable.Mode(GridEditMode.InCell))
          .DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Batch(true)
                                        .ServerOperation(true)
                                        .Model(model =>
                                                   {
                                                       model.Id(m => m.QuestionTemplateId);
                                                       model.Field(m => m.QuestionTemplateId).Editable(false);
                                                       model.Field(m => m.QuestionGroupTemplateId).Editable(false);
                                                   })
                                        .Read(read => read.Action("ReadAssignedQuestions", "QuestionManagement", new { p = "#=QuestionGroupTemplateId#"})
                                                          .Type(HttpVerbs.Post)                                                         
                                        )
                                        .Update(update => update.Action("SaveAssignedQuestions", "QuestionManagement"))
          )
          .ToClientTemplate()
          )
        </script>
0
Software
Top achievements
Rank 1
answered on 10 Dec 2012, 01:13 PM
I don't know if this is any further help, but when paused on the throw Error code, it has variables e and l for the 'Invalid Template: and Generated Code:.  I will provide those now.

variable 'e' representing 'Invalid Template:':
    <div class="k-widget k-grid" id="Questions_#=QuestionGroupTemplateId#"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-save-changes" href="#"><span class="k-icon k-update"></span>Save changes</a><a class="k-button k-button-icontext k-grid-cancel-changes" href="#"><span class="k-icon k-cancel"></span>Cancel changes</a></div><table cellspacing="0"><colgroup><col /><col /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="QuestionTemplateId" data-title="[en-US: QuestionTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionTemplateId]</span></th><th class="k-header" data-field="QuestionGroupTemplateId" data-title="[en-US: QuestionGroupTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionGroupTemplateId]</span></th><th class="k-header" data-field="Required" data-title="Required" scope="col"><span class="k-link">Required</span></th><th class="k-header" data-field="QuestionText" data-title="Question Text" scope="col"><span class="k-link">Question Text</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="2"></td></tr></tbody></table></div><script>
    jQuery(function(){jQuery("\#Questions_#=QuestionGroupTemplateId#").kendoGrid({"columns":[{"title":"[en-US: QuestionTemplateId]","hidden":true,"field":"QuestionTemplateId","encoded":true},{"title":"[en-US: QuestionGroupTemplateId]","hidden":true,"field":"QuestionGroupTemplateId","encoded":true},{"title":"Required","field":"Required","encoded":true,"editor":"\u003cdiv class=\"baseEditorTemplate\" style=\"\"\u003e\u003cdiv\u003e    \u003c/div\u003e        \u003cdiv\u003e        \u003clabel for=\"Required\" title=\"Required\"\u003eRequired\u003c/label\u003e\u0026nbsp;\u003cinput class=\"checkBoxes\" data-val=\"true\" data-val-required=\"The Required field is required!!.\" id=\"Required\" name=\"Required\" title=\"Required\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"Required\" type=\"hidden\" value=\"false\" /\u003e    \u003c/div\u003e    \u003cdiv id=\"errorMsg\"\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Required\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"Required\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"title":"Question Text","field":"QuestionText","encoded":true,"editor":"\u003cdiv class=\"baseEditorTemplate\"\u003e\u003cdiv\u003e    \u003clabel for=\"QuestionText\" title=\"Question Text\"\u003eQuestion Text\u003c/label\u003e\u003c/div\u003e\u003cdiv\u003e\u003cinput class=\"k-textbox\" data-val=\"true\" data-val-required=\"The Question Text field is required!!.\" id=\"QuestionText\" name=\"QuestionText\" title=\"Question Text\" type=\"text\" value=\"\" /\u003e    \u003cdiv id=\"errorMsg\"\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"QuestionText\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e\u003c/div\u003e      \u003c/div\u003e\u003c/div\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"QuestionText\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"}],"scrollable":false,"editable":{"confirmation":"Are you sure you want to delete this item?","mode":"incell","template":null,"create":true,"update":true,"destroy":true},"toolbar":{"command":[{"name":null,"buttonType":"ImageAndText"}]},"dataSource":{"transport":{"read":{"url":"/Administration/QuestionManagement/ReadAssignedQuestions/#=QuestionGroupTemplateId#","type":"POST"},"update":{"url":"/Administration/QuestionManagement/SaveAssignedQuestions"}},"type":"aspnetmvc-ajax","schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"QuestionTemplateId","fields":{"QuestionTemplateId":{"editable":false,"type":"number"},"QuestionGroupTemplateId":{"editable":false,"type":"number"},"QuestionText":{"type":"string"},"Required":{"type":"boolean"}}}},"batch":true}});});
<\/script>

variable 'l' representing 'Generate code:'
var o,e=kendo.htmlEncode;with(data){o='\n \n    <div class="k-widget k-grid" id="Questions_'+(QuestionGroupTemplateId)+'"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-save-changes" href="';"><span class="k-icon k-update"></span>Save changes</a><a class="k-button k-button-icontext k-grid-cancel-changes" href=";o+='"><span class="k-icon k-cancel"></span>Cancel changes</a></div><table cellspacing="0"><colgroup><col /><col /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="QuestionTemplateId" data-title="[en-US: QuestionTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionTemplateId]</span></th><th class="k-header" data-field="QuestionGroupTemplateId" data-title="[en-US: QuestionGroupTemplateId]" scope="col" style="display:none"><span class="k-link">[en-US: QuestionGroupTemplateId]</span></th><th class="k-header" data-field="Required" data-title="Required" scope="col"><span class="k-link">Required</span></th><th class="k-header" data-field="QuestionText" data-title="Question Text" scope="col"><span class="k-link">Question Text</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="2"></td></tr></tbody></table></div><script>\n\tjQuery(function(){jQuery("#Questions_'+(QuestionGroupTemplateId)+'").kendoGrid({"columns":[{"title":"[en-US: QuestionTemplateId]","hidden":true,"field":"QuestionTemplateId","encoded":true},{"title":"[en-US: QuestionGroupTemplateId]","hidden":true,"field":"QuestionGroupTemplateId","encoded":true},{"title":"Required","field":"Required","encoded":true,"editor":"\u003cdiv class=\\\"baseEditorTemplate\\\" style=\\\"\\\"\u003e\u003cdiv\u003e    \u003c/div\u003e        \u003cdiv\u003e        \u003clabel for=\\\"Required\\\" title=\\\"Required\\\"\u003eRequired\u003c/label\u003e\u0026nbsp;\u003cinput class=\\\"checkBoxes\\\" data-val=\\\"true\\\" data-val-required=\\\"The Required field is required!!.\\\" id=\\\"Required\\\" name=\\\"Required\\\" title=\\\"Required\\\" type=\\\"checkbox\\\" value=\\\"true\\\" /\u003e\u003cinput name=\\\"Required\\\" type=\\\"hidden\\\" value=\\\"false\\\" /\u003e    \u003c/div\u003e    \u003cdiv id=\\\"errorMsg\\\"\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"Required\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"Required\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e"},{"title":"Question Text","field":"QuestionText","encoded":true,"editor":"\u003cdiv class=\\\"baseEditorTemplate\\\"\u003e\u003cdiv\u003e    \u003clabel for=\\\"QuestionText\\\" title=\\\"Question Text\\\"\u003eQuestion Text\u003c/label\u003e\u003c/div\u003e\u003cdiv\u003e\u003cinput class=\\\"k-textbox\\\" data-val=\\\"true\\\" data-val-required=\\\"The Question Text field is required!!.\\\" id=\\\"QuestionText\\\" name=\\\"QuestionText\\\" title=\\\"Question Text\\\" type=\\\"text\\\" value=\\\"\\\" /\u003e    \u003cdiv id=\\\"errorMsg\\\"\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"QuestionText\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e\u003c/div\u003e      \u003c/div\u003e\u003c/div\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"QuestionText\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e"}],"scrollable":false,"editable":{"confirmation":"Are you sure you want to delete this item?","mode":"incell","template":null,"create":true,"update":true,"destroy":true},"toolbar":{"command":[{"name":null,"buttonType":"ImageAndText"}]},"dataSource":{"transport":{"read":{"url":"/Administration/QuestionManagement/ReadAssignedQuestions/'+(QuestionGroupTemplateId)+'","type":"POST"},"update":{"url":"/Administration/QuestionManagement/SaveAssignedQuestions"}},"type":"aspnetmvc-ajax","schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"QuestionTemplateId","fields":{"QuestionTemplateId":{"editable":false,"type":"number"},"QuestionGroupTemplateId":{"editable":false,"type":"number"},"QuestionText":{"type":"string"},"Required":{"type":"boolean"}}}},"batch":true}});});\n<\/script>\n        ';}return o;
Thanks!
Danny Green



0
Accepted
Vladimir Iliev
Telerik team
answered on 12 Dec 2012, 09:10 AM
Hi Danny,

 
Basically the Invalid Template error is caused by the Save button in the child grid toolbar which outputs "#" character (which is used by Kendo Templates) in the href attribute of the button. Please note that this issue is already fixed in the latest internal build which is available for download from your account at telerik.com.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Michael
Top achievements
Rank 1
answered on 31 Dec 2012, 07:23 PM
I ran into the same issue with using Editable Hierarchical Grid with Update/Save option. I will try the internal build:

Microsoft JScript runtime error: Invalid template:'

    <div class="k-widget k-grid" id="Orders_#=EmployeeID#"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-add" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-mode=insert"><span class="k-icon k-add"></span>Add new item</a><a class="k-button k-button-icontext k-grid-save-changes" href="#"><span class="k-icon k-update"></span>Save changes</a><a class="k-button k-button-icontext k-grid-cancel-changes" href="#"><span class="k-icon k-cancel"></span>Cancel changes</a></div><table cellspacing="0"><colgroup><col style="width:101px" /><col style="width:140px" /><col style="width:200px" /><col style="width:200px" /><col style="width:110px" /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="OrderID" data-title="Order ID" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=OrderID-asc">Order ID</a></th><th class="k-header" data-field="ShipCountry" data-title="Ship Country" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=ShipCountry-asc">Ship Country</a></th><th class="k-header" data-field="ShipAddress" data-title="Ship Address" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=ShipAddress-asc">Ship Address</a></th><th class="k-header" data-field="ShipName" data-title="Ship Name" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=ShipName-asc">Ship Name</a></th><th class="k-header" scope="col"><span class="k-link">&nbsp;</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="5"></td></tr></tbody></table><div class="k-pager-wrap k-grid-pager"><a class="k-link k-state-disabled" data-page="1" href="\#" title="Go to the first page"><span class="k-icon k-i-seek-w">seek-w</span></a><a class="k-link k-state-disabled" data-page="0" href="\#" title="Go to the previous page"><span class="k-icon k-i-arrow-w">arrow-w</span></a><ul class="k-pager-numbers k-reset"><li><span class="k-state-selected" data-page="1">1</span></li></ul><a class="k-link k-state-disabled" data-page="2" href="\#" title="Go to the next page"><span class="k-icon k-i-arrow-e">arrow-e</span></a><a class="k-link k-state-disabled" data-page="1" href="\#" title="Go to the last page"><span class="k-icon k-i-seek-e">seek-e</span></a><span class="k-pager-info k-label">0 - 0 of 0 items</span></div></div><script>

                jQuery(function(){jQuery("\#Orders_#=EmployeeID#").kendoGrid({"columns":[{"title":"Order ID","width":"101px","field":"OrderID","encoded":true,"editor":"\u003cinput class=\"text-box single-line\" data-val=\"true\" data-val-number=\"The field OrderID must be a number.\" data-val-required=\"The OrderID field is required.\" id=\"OrderID\" name=\"OrderID\" type=\"text\" value=\"0\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"OrderID\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"title":"Ship Country","width":"140px","field":"ShipCountry","encoded":true,"editor":"\u003cinput class=\"text-box single-line\" id=\"ShipCountry\" name=\"ShipCountry\" type=\"text\" value=\"\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"ShipCountry\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"title":"Ship Address","width":"200px","field":"ShipAddress","encoded":true,"editor":"\u003cinput class=\"text-box single-line\" id=\"ShipAddress\" name=\"ShipAddress\" type=\"text\" value=\"\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"ShipAddress\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"title":"Ship Name","width":"200px","field":"ShipName","encoded":true,"editor":"\u003cinput class=\"text-box single-line\" id=\"ShipName\" name=\"ShipName\" type=\"text\" value=\"\" /\u003e\u003cspan class=\"field-validation-valid\" data-valmsg-for=\"ShipName\" data-valmsg-replace=\"true\"\u003e\u003c/span\u003e"},{"width":"110px","command":[{"name":"destroy","buttonType":"ImageAndText","text":"Delete"}]}],"pageable":{"buttonCount":10},"sortable":true,"scrollable":false,"editable":{"confirmation":"Are you sure you want to delete this item?","mode":"incell","template":null,"create":true,"update":true,"destroy":true},"toolbar":{"command":[{"name":null,"buttonType":"ImageAndText","text":"Add new item"},{"name":null,"buttonType":"ImageAndText"}]},"dataSource":{"transport":{"read":{"url":"/Home/HierarchyBinding_Orders_Read?employeeID=#=EmployeeID#"},"update":{"url":"/Home/HierarchyBinding_Orders_Update"},"create":{"url":"/Home/HierarchyBinding_Orders_Create"},"destroy":{"url":"/Home/HierarchyBinding_Orders_Destroy"}},"pageSize":10,"page":1,"total":0,"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-ajax","filter":[],"error":error_handler,"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"OrderID","fields":{"ContactName":{"type":"string"},"OrderDate":{"type":"date"},"OrderID":{"type":"number"},"ShipAddress":{"type":"string"},"ShipCountry":{"type":"string"},"ShipName":{"type":"string"},"EmployeeID":{"type":"number"}}}}}});});

<\/script>

' Generated code:'var o,e=kendo.htmlEncode;with(data){o='\n    <div class="k-widget k-grid" id="Orders_'+(EmployeeID)+'"><div class="k-toolbar k-grid-toolbar k-grid-top"><a class="k-button k-button-icontext k-grid-add" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-mode=insert"><span class="k-icon k-add"></span>Add new item</a><a class="k-button k-button-icontext k-grid-save-changes" href="';"><span class="k-icon k-update"></span>Save changes</a><a class="k-button k-button-icontext k-grid-cancel-changes" href=";o+='"><span class="k-icon k-cancel"></span>Cancel changes</a></div><table cellspacing="0"><colgroup><col style="width:101px" /><col style="width:140px" /><col style="width:200px" /><col style="width:200px" /><col style="width:110px" /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="OrderID" data-title="Order ID" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=OrderID-asc">Order ID</a></th><th class="k-header" data-field="ShipCountry" data-title="Ship Country" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=ShipCountry-asc">Ship Country</a></th><th class="k-header" data-field="ShipAddress" data-title="Ship Address" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=ShipAddress-asc">Ship Address</a></th><th class="k-header" data-field="ShipName" data-title="Ship Name" scope="col"><a class="k-link" href="/Home/HierarchyBinding_Orders_Read?employeeID=%23%3DEmployeeID%23&amp;Orders_%23%3DEmployeeID%23-sort=ShipName-asc">Ship Name</a></th><th class="k-header" scope="col"><span class="k-link">&nbsp;</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="5"></td></tr></tbody></table><div class="k-pager-wrap k-grid-pager"><a class="k-link k-state-disabled" data-page="1" href="#" title="Go to the first page"><span class="k-icon k-i-seek-w">seek-w</span></a><a class="k-link k-state-disabled" data-page="0" href="#" title="Go to the previous page"><span class="k-icon k-i-arrow-w">arrow-w</span></a><ul class="k-pager-numbers k-reset"><li><span class="k-state-selected" data-page="1">1</span></li></ul><a class="k-link k-state-disabled" data-page="2" href="#" title="Go to the next page"><span class="k-icon k-i-arrow-e">arrow-e</span></a><a class="k-link k-state-disabled" data-page="1" href="#" title="Go to the last page"><span class="k-icon k-i-seek-e">seek-e</span></a><span class="k-pager-info k-label">0 - 0 of 0 items</span></div></div><script>\n\tjQuery(function(){jQuery("#Orders_'+(EmployeeID)+'").kendoGrid({"columns":[{"title":"Order ID","width":"101px","field":"OrderID","encoded":true,"editor":"\u003cinput class=\\\"text-box single-line\\\" data-val=\\\"true\\\" data-val-number=\\\"The field OrderID must be a number.\\\" data-val-required=\\\"The OrderID field is required.\\\" id=\\\"OrderID\\\" name=\\\"OrderID\\\" type=\\\"text\\\" value=\\\"0\\\" /\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"OrderID\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e"},{"title":"Ship Country","width":"140px","field":"ShipCountry","encoded":true,"editor":"\u003cinput class=\\\"text-box single-line\\\" id=\\\"ShipCountry\\\" name=\\\"ShipCountry\\\" type=\\\"text\\\" value=\\\"\\\" /\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"ShipCountry\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e"},{"title":"Ship Address","width":"200px","field":"ShipAddress","encoded":true,"editor":"\u003cinput class=\\\"text-box single-line\\\" id=\\\"ShipAddress\\\" name=\\\"ShipAddress\\\" type=\\\"text\\\" value=\\\"\\\" /\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"ShipAddress\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e"},{"title":"Ship Name","width":"200px","field":"ShipName","encoded":true,"editor":"\u003cinput class=\\\"text-box single-line\\\" id=\\\"ShipName\\\" name=\\\"ShipName\\\" type=\\\"text\\\" value=\\\"\\\" /\u003e\u003cspan class=\\\"field-validation-valid\\\" data-valmsg-for=\\\"ShipName\\\" data-valmsg-replace=\\\"true\\\"\u003e\u003c/span\u003e"},{"width":"110px","command":[{"name":"destroy","buttonType":"ImageAndText","text":"Delete"}]}],"pageable":{"buttonCount":10},"sortable":true,"scrollable":false,"editable":{"confirmation":"Are you sure you want to delete this item?","mode":"incell","template":null,"create":true,"update":true,"destroy":true},"toolbar":{"command":[{"name":null,"buttonType":"ImageAndText","text":"Add new item"},{"name":null,"buttonType":"ImageAndText"}]},"dataSource":{"transport":{"read":{"url":"/Home/HierarchyBinding_Orders_Read?employeeID='+(EmployeeID)+'"},"update":{"url":"/Home/HierarchyBinding_Orders_Update"},"create":{"url":"/Home/HierarchyBinding_Orders_Create"},"destroy":{"url":"/Home/HierarchyBinding_Orders_Destroy"}},"pageSize":10,"page":1,"total":0,"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-ajax","filter":[],"error":error_handler,"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"OrderID","fields":{"ContactName":{"type":"string"},"OrderDate":{"type":"date"},"OrderID":{"type":"number"},"ShipAddress":{"type":"string"},"ShipCountry":{"type":"string"},"ShipName":{"type":"string"},"EmployeeID":{"type":"number"}}}}}});});\n<\/script>\n';}return o;'

0
Michael
Top achievements
Rank 1
answered on 31 Dec 2012, 08:53 PM
I updated my project with the latest KendoUI internal build and the issue is now resolved.
Tags
Grid
Asked by
Software
Top achievements
Rank 1
Answers by
Software
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Michael
Top achievements
Rank 1
Share this question
or