Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2165
Change cell value after checkbox change
posted

I need to set a value to a cell ("TotalCol") when user uncheck another cell ("UseCol") in the same row. I am using GridEditMode.Row. How to do it? I don't want to force user to change focus to another row or cell to make it work. Thanks.

By the way, everything should be recorded in the transactionlog! ;)

Parents
  • 20255
    Suggested Answer
    Offline posted

    Hello Luis,

    Thank you for using our forum.

    If you don't want to force the user to do anything then my suggestion is to attach a delegate to the checkbox element and from there to handle the cell updating. I have created a sample for you that is showing this approach.

    http://jsfiddle.net/e7aLtzt4/4/show/

    Code snippet:

    $("#grid").on( "click",$($($( ".ui-iggrid-editingcell" ).find(".ui-igcheckbox-small")[0]).find("span")), function() {
        setTimeout(function(){
         //get the row which is in editing mode
         var rowId = $($(".ui-iggrid-editingcell").parent()[1]).attr("data-id");
         var row = $("#grid").igGrid("rowById", rowId);


         //or directly perform cell changing
        
         $("#grid").igGridUpdating("setCellValue", rowId, "ProductNumber", "111111111");
        }, 100);
       });

    Let me know if I may be of further assistance.

Reply Children