Unplanned
Last Updated: 13 Aug 2024 05:26 by ADMIN
Phạm
Created on: 06 Aug 2024 10:14
Category: UI for ASP.NET MVC
Type: Bug Report
0
Cannot pass parameter into function binding to a column in grid
I have a grid like this:

@(Html.Kendo().Grid<VIP_Logic.Models.Dashboard.CriteriaModel>().Name("dgdCriteria")
                  .Columns(column =>
                  {
                      column.Bound(b => b.ParamIndex).Title("No.").Width(40);
                      column.ForeignKey(b => b.ColumnName, (IEnumerable<SelectListItem>)ViewBag.LstColumnNames, "value", "text").HtmlAttributes(new { style = "text-align: left", onChange = "onChangeColumn('#=ParamIndex#');" }).Title("Column").Width(100);
                      column.ForeignKey(b => b.Operator, (IEnumerable<SelectListItem>)ViewBag.LstOperators, "value", "text").HtmlAttributes(new { style = "text-align: left", onChange = "onChangeOperator('#=ParamIndex#');" }).Title("Operator").Width(100);
                      column.Bound(b => b.ParamValue).HtmlAttributes(new { style = "text-align: left", onChange = "setCriteriaXml();" }).Title("Value").Width(150).Encoded(false);
                      column.Bound(b => b.ParamIndex).ClientTemplate("<button class= 'k-button' type='button' onclick=onRemoveCriteria('#=ParamIndex#')>" + "Remove" + "</button>").HtmlAttributes(new { style = "text-align: center" }).Title(string.Empty).Width(50);
                  })

All the function in onchange attribute required a parameter ParamIndex. In old version, the syntax "#=ParamIndex#'" still work fine, but since i upgrade Kendo UI to latest version, this syntax doesn't work anymore. How can i make it work like old version?
0 comments