We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Template Refresh for the Boolean Checkbox in Batch Edit

Hi,

I've a boolean column that displays as checkbox in my grid which has batch edit enabled. I'm using the Javascript API method setCellValue to update all the records to true but the grid displays true instead of a checked checkbox.

Should I be refreshing template? I've tried it but no success.


   var obj = $("#GridSample1").ejGrid("instance");

   for (var i = 0; i < obj.model.currentViewData.length; i++) {

        obj.setCellValue(i, "Status", true)//updating each cell of Status to true

   }


Regards,

Ajay


1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team July 6, 2016 08:50 AM UTC

Hi Ajay, 
 
Thanks for contacting Syncfusion support. 
 
In Essential Studio Version 14.1.0.46  we face the mentioned issue while using setCellValue method of ejGrid. We have already fixed the issue and fix has been included in the 14.2.0.26 version.  So, we suggest you to upgrade to the latest Essential studio version. 
 
Find the code example and sample: 
 
 
@(Html.EJ().Grid<object>("Editing") 
        .Datasource((IEnumerable<object>)ViewBag.dataSource) 
        .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch); }) 
        ------------------------ 
        .ClientSideEvents(eve => { eve.Create("context"); }) 
        ---------------------------- 
) 
 
<script> 
    function context(args) { 
        var obj = $("#Editing").ejGrid("instance"); 
        for (var i = 0; i < obj.model.currentViewData.length; i++) { 
            obj.setCellValue(i, "Verified", true)//updating each cell of Status to true 
        } 
    } 
</script> 
 
 
Regards, 
Prasanna Kumar N.S.V 
 
  


Loader.
Up arrow icon