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
175
how make cell 'dirty' setting value programmatically?
posted

Hi, I have checkbox template for string field and don't know how to make cell 'dirty' so the editor dialog "Done" Cancel" could see it.

When user click check box cell changes text value fine (valid/invalid) but editor doesn't see it.

I tried this:

var  temp = "<input type='checkbox' {{if ${ValidOrInvalid} == 'Valid'}} checked='checked' {{/if}} onclick='changeState(this, ${Id})'>${ValidOrInvalid}";

 var DefaultColumns = [

         { headerText: "Valid Or Invalid", key: "ValidOrInvalid", dataType: "string", width: "10%", template: temp },  

and:

function changeState(element, rowId) {

    var $checkBox = $(element);

    if ($checkBox.prop("checked")) {

        $("#grid").igGridUpdating("setCellValue", rowId, "ValidOrInvalid", "Valid");

    } else {

        $("#grid").igGridUpdating("setCellValue", rowId, "ValidOrInvalid", "Invalid");

    }

    setTimeout(function () { $("#grid").igGridUpdating("startEdit", rowId, 1); }, 2);

}

But no luck, thanks