jQuery UI Widgets Forums Grid get currently editing cell

This topic contains 2 replies, has 2 voices, and was last updated by  Réka 9 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • get currently editing cell #69248

    Réka
    Participant

    Hello!

    Is there an option to get a reference to the cell that the user is currently editing? (Something like the $(“#jqxgrid”).jqxGrid(‘getselectedrowindex’), but I would like to know the rowindex and the datafield)

    Thank you,
    Reka

    get currently editing cell #69250

    Dimitar
    Participant

    Hello Reka,

    You can get this information in the column’s cellbeginedit callback function. Here is more about it from the API Documentation:

    cellbeginedit – sets a custom function which is called when a cell enters into edit mode. The Grid passes 3 parameters to it – row index, column data field and column type. The function can be used for canceling the editing of a specific Grid cell. To cancel the editing, the function should return false.

    { text: ‘Product’, columntype: ‘dropdownlist’, datafield: ‘productname’, width: 177,
    cellbeginedit: function (row, datafield, columntype) {
    if (row == 2)
    return false;
    }
    }

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    get currently editing cell #69255

    Réka
    Participant

    Hi Dimitar,

    Thank you. I think I can use this as a workaround.
    My concrete scenario is that I have a grid with a nested grid in it and I must have only one selected row at a time from one grid. So if I select a row in the nested grid none of the parent grid’s row should be selected and vice-versa. I used the jqxGrid(‘clearselection’) function to achieve this, but it seems that the ‘endcelledit’ event is not getting fired in case of the parent grid. (maybe because I do not have to click outside of the grid to select an item from the nested one)
    I will create an event handler for the cellbeginedit as you suggested and store in a variable the necessary information so that the jqxGrid(‘endcelledit’, rowIndex, dataField, true) function can be called on the parent grid. Any better idea is welcome 🙂

    Thanks,
    Reka

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.