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
500
Grid Checkbox event
posted

Hi,

In the sample attached, the boolean value in the grid is rendered as checkbox, but none of following editor event is triggered.

valuedChanged

keydown

keypress

keyup

click

I'd like to capture checkbox event, espeically valueChanged event, in our application to do some business logic validation. editCellStarting, editCellEnding do not fit our application require, because once checkbox is set focus, the value can be changed, and editCelllEnding event only fired once when checkbox lost focus.

Any comment/suggestion is appreciated,

Michael

gridCheckboxEditorEventSample.zip
Parents
No Data
Reply
  • 23953
    Suggested Answer
    Offline posted

    Hi Michael,

    Checkbox is not part of the editors, so it doesn't have the events you stated.

    One way I can think of which will help you to get the value of the checkbox is to handle the igGrid cellClick event. In there get the editor for the column with igGridUpdating.editorForKey method. You can get the value of the checkbox editor provider (which is not igEditor instance) using editor.data("igEditorFilter").options.provider.value.

    Here is an example code:

    $("#grid1").on("iggridcellclick", function(evt, ui) {

        var editor = $("#grid1").igGridUpdating("editorForKey", "Selected");

        if (editor != null && editor.data("igEditorFilter"))

            var value = editor.data("igEditorFilter").options.provider.value;

    });

     

     

    Another approach is to extend $.ig.EditorProviderCheckbox, but that's another talk (I hope that the solution which I describe in this post will work for you).

     

    Hope this helps,

    Martin Pavlov

    Infragistics, Inc.

Children