Note that there are some explanatory texts on larger screens.

plurals
  1. POFor Loop in Kendo Grid Template
    text
    copied!<p>I've a big trouble with Kendo Grid.</p> <p>If I use a for loop as client template as this</p> <pre><code>col.Bound(m =&gt; m.Compteurs) .ClientTemplate("# for (var i=0;i&lt;4;i++) { console.log(i) } #"); </code></pre> <p>i is never incremented. Same with while loop and increment inside loop.</p> <p>how to resolve this ?</p> <p>Thank you</p> <p>EDIT - Full declaration of Grid : </p> <pre><code>@(Html.Kendo().Grid&lt;EAGLE.Models.ParamUf&gt;() .Name("ParamGrid") .Columns(col =&gt; { col.Bound(m =&gt; m.Groupement); col.Bound(m =&gt; m.Etablissement).ClientTemplate("#= Etablissement.EtablissementName #"); col.Bound(m =&gt; m.Service).ClientTemplate("#= Service.ServiceName #"); col.Bound(m =&gt; m.Discipline).ClientTemplate("#= Discipline.DisciplineName #"); col.Bound(m =&gt; m.Unite).ClientTemplate("#= Unite.UniteName #"); col.Bound(m =&gt; m).ClientTemplate(Html.Partial("_Tel").ToHtmlString()); col.Bound(m =&gt; m.Unite.TypeHebergement).Title("Hébergement"); col.Bound(m =&gt; m.Installe); col.Bound(m =&gt; m.Ferme); col.Bound(m =&gt; m.Compteurs).ClientTemplate("# for (var i=0;i&lt;4;i++) { console.log(i) } #"); col.Command(commands =&gt; { commands.Edit().UpdateText("Mettre à jour").CancelText("Annuler").Text("Edit"); commands.Destroy().Text("Suppr."); }).Title(string.Empty).Width(160); } ) .DataSource(data =&gt; data .Ajax() .Read(read =&gt; read.Action("Param_Read", "Param", new { entityCode = @ViewBag.Code, entityType = @ViewBag.Type }).Data("filterUnit")) .Model(m =&gt; { m.Id(a =&gt; a.Unite.UniteCode); m.Field(a =&gt; a.Etablissement).DefaultValue(new EAGLE.Models.Etablissement()); m.Field(a =&gt; a.Service).DefaultValue(new EAGLE.Models.Service()); m.Field(a =&gt; a.Discipline).DefaultValue(new EAGLE.Models.Discipline()); m.Field(a =&gt; a.Unite).DefaultValue(new EAGLE.Models.Unite()); }) .Create(cre =&gt; cre.Action("Param_Create", "Param")) .Update(upd =&gt; upd.Action("Param_Update", "Param")) .Destroy(des =&gt; des.Action("Param_Destroy", "Param")) .Batch(false) .ServerOperation(false)) .Pageable(pager =&gt; pager .Enabled(false) .Messages(m =&gt; m.Display("Nombre total d'hébergement : {2}")) .Messages(m =&gt; m.Empty("Pas d'hébergement.")) .PreviousNext(false) .Input(false) .Numeric(false)) .ToolBar(toolbar =&gt; { toolbar.Create(); }) .Editable(ed =&gt; ed.Mode(GridEditMode.PopUp).TemplateName("_ParamEdit")) .Events(e =&gt; e.DataBound("onDatabound")) ) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload