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
Edit a cell in a column while another cell updates in the background
posted

Hello,

I have a grid with 3 fields, name, status and duration time, the duration field is calculated in a function and is updated every second, but if I try to modify the name cell and at that moment the duration cell is updated I lose the focus and the name field returns to its previous value.

Is there a way that both fields can be modified at the same time and this is in real time for the user? Or is there a function that shows me the duration time field in real time without executing igGridUpdating and allows me to modify the name.

Thanks.

  • 1320
    Offline posted

    Hello Tatiana,

    After investigating this further, I have determined that your requirement could be achieved by changing the innerText of the duration cell and not using the setCellValue method in order not to lose focus when another cell is being edited.

    Additionally, a method should be bound to the editCellEnding event. In this method by using setCellValue the innerText of the Duration cell in the edited row would be set. This could be achieved as follows:

    features: [

                        {

                            name: "Updating",

                            enableAddRow: true,

                            editMode: "cell",

                            enableDeleteRow: true,

                            editCellEnding: function (evt, ui) {

                                let date = $("#gridProducts").igGrid("cellById", ui.rowID, "Duration")[0].innerText;

                                $("#gridProducts").igGridUpdating("setCellValue", ui.rowID, "Duration", date);

                            },

    ]

    Below I am attaching a sample demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.

    Regards,
    Monika Kirkova,
    Infragistics

    igGridUpdateValues.zip