Hi,
I think I found a little (big) bug in the grids ClientTemplate. I use JavaScript-Code in a ClientTemplate. The problem is, that the + sign doesn't work.
Here is what I tried:
.ClientTemplate("<ul>#for(var i = 0; i < myObj.length; i++){#<li>#=myObj[i].Name#</li>#}#</ul>");
I simplified the template a little bit. The fact is, that the i++ in my for-loop doesn't work. It gets to be an endless loop. If I set a debugger in there, I can only see for(var i = 0; i < myObj.length; i ) --> The + signs are missing! And it doesn't matter where I use the +. It isn't displayed when I debugg the code.
I hope you understand what I mean!
My current workaround is to use -(-1) .............. #for(var i = 0; i < myObj.length; i = i-(-1)){#
I am working with the good example of Editing custom editor under the MVC examples.
It shows how to build a dropdownlist for use when editing a cell in a grid.
I have to create a new post in the grid and I add the following to the file; Editing_Custom.cshtml:
.Create(create => create.Action("EditingCustom_Create", "Grid")) .ToolBar(toolBar => { toolBar.Save(); toolBar.Create(); })And I already get an error here before I come to do the coding in the .cs-file.
When debugging with firebug, I get an error from javascript that says: ReferenceError: EnrollTypes is not defined.
EnrollTypes is the class that is used for making the dropdownlist.
Could someone please give me a hint on what I have to do when creating a post in a grid with relational data?
I saw in some forum that Foregin key will sove this problem, but in my case there is no key column which can be named as foreign key. I just want to have a dropdown in grid column and it should also appear when I click on Add New Item button.
Regards,
Nandan
<div style="float: left; margin-right: 10px"> <input id="calendars" /></div><div style="float: left; margin-right: 10px"> <input id="periods" /></div><div class="clearfix"></div>$(document).ready(function () { $("#calendars").kendoDropDownList({ optionLabel: "Select calendar...", dataTextField: "CalendarText", dataValueField: "CalendarCode", dataSource: { type: "json", serverFiltering: true, transport: { read: "http://www.someurl.com/AppName/SomeArea/SomeController/GetCalendars" } } }); var periods = $("#periods").kendoDropDownList({ autoBind: false, cascadeFrom: "calendars", optionLabel: "Select period...", dataTextField: "PeriodCode", dataValueField: "PeriodCode", dataSource: { type: "json", serverFiltering: true, transport: { read: "http://www.someurl.com/AppName/SomeArea/SomeController/GetPeriods" } } }).data("kendoDropDownList");});