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
15
Direct edtion in a cell.
posted

Hello,

I'm working on using the grid Updating feature. I noticed that on the first click on a cell that can be edited the current behaviour is that the cell/row enters in edition mode but it doesn't change the value. Sometimes I found it a bit weird for exemple when the column is boolean and rendered as a checkbox. in this case I would like it to change the value of the cell on the first click (only on the chek box). Is there an out of the box way of doing so? or is there an acceptable work arround ?

Best regards.

  • 660
    Offline posted

    Hello,

    Thank you for posting into our community!

    I have been looking into your question and what I could suggest, in order to achieve your requirement, is using the igGridUpdating feature’s editCellStarting event and checking if the columnKey of the currently edited cell is the one that is set to dataType bool and also if the original event’s target has the ui-icon-check css class. Then, if this check is true, the value, i.e., ui.value, should be set to the opposite value.

    This could look similar to the following:

    editCellStarting: function(evt, ui) {
        if (ui.columnKey === "Active" && $(evt.originalEvent.target).hasClass("ui-icon-check")) {
            ui.value = !ui.value;
        }
    },

    Additionally, in order to demonstrate my suggestion, I have prepared a small sample and it could be found here.

    Please test it on your side and let me know if you need any further assistance regarding this matter.

    Looking forward to your reply.

    Sincerely,
    Riva Ivanova
    Entry Level Software Developer