jQuery UI Widgets Forums Grid How to refresh or reset a single cell?

This topic contains 3 replies, has 2 voices, and was last updated by  ejianwei 9 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • ejianwei
    Participant

    Hi,

    The background of my problem is that: I want to do the validation of user input by myself, and I implement it in the “cellendedit” event function. The code is:

            my_grid.on('cellendedit', function (event) {
                var args = event.args;
                if (my_validate(args.datafield, args.value)) {
                    my_grid.jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value);
                } else {
                    my_grid.jqxGrid('setcellvalue', args.rowindex, args.datafield, args.oldvalue);
                    //code to refresh the cell
                }
                
            });

    Could anybody tell me how to refresh only this cell to it’s original value? thanks!


    ejianwei
    Participant

    forget something, if validation fails, there will pop-up a window showing that the input is invalid. After the user close the pop-up window, the cell should refresh to it’s original value, so the user could input a valid data again.


    ivailo
    Participant

    Hi ejianwei,

    You can use cellvaluechanging callback instead on('cellendedit',...
    Here is the fiddle.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    ejianwei
    Participant

    thanks!

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

You must be logged in to reply to this topic.