BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
...
col.Field("IsNew").HeaderText("Is It New ?").Template(true).TemplateID("#IsNewTemplate").TextAlign(TextAlign.Center).Width(75).Add();
...
Error:
Uncaught Error: Syntax error, unrecognized expression: #FlatGridId It New ?6_Template
[Template] <script id="IsNewTemplate" type="text/x-jsrender"> <input type="checkbox" class="rowCheckbox" {{if IsNew }} checked {{/if}}/> </script>
<div class="row">
[Grid code]
@(Html.EJ().Grid<Orders>("Grid") .Datasource((IEnumerable<Orders>)ViewBag.griddata) .AllowPaging() .PageSettings(page=>page.PageSize(3)) .Columns(col => { col.Field("OrderID").HeaderText("Order ID?").Add(); col.Field("IsNew").HeaderText("Is it New").Template(true).TemplateID("#IsNewTemplate").Add(); }) .ClientSideEvents(evt=>evt.TemplateRefresh("renderICheck")) ) </div>
[templateRefresh event] <script type="text/javascript">
function renderICheck(args) { $('.rowCheckbox', args.cell).iCheck({ checkboxClass: 'icheckbox_minimal', radioClass: 'iradio_minimal', increaseArea: '20%' // optional }); }
|
Please follow the below steps to upgrade to 13.2.0.34.
1. Download and install the Essential Studio v13.2.0.34 from the below link.
2. Replace the Syncfusion DLLs, scripts, and CSS in your project from the following location.
Scripts and CSS: C:\Program Files (x86)\Syncfusion\Essential Studio\XX.X.X.XX\JavaScript\assets
DLLs: C:\Program Files (x86)\Syncfusion\Essential Studio\ XX.X.X.XX \Assemblies
Here XX.X.X.XX denotes the product version(13.2.0.34).
If you are not willing to upgrade then we can use the queryCellInfo event to achieve the requirement.
@(Html.EJ().Grid<Orders>("Grid") . . . . .ClientSideEvents(evt => evt.QueryCellInfo("renderICheck")) function renderICheck(args) { if (args.column.field == "IsNew") { //To skip other cells $('.rowCheckbox', args.cell).iCheck({ checkboxClass: 'icheckbox_minimal', radioClass: 'iradio_minimal', increaseArea: '20%’ }); } |