Can I control the grid event function to run only once?

I want to control the grid event function to run only once. Is there any related grammar?

If Iā€™m understanding what you are trying to do, I use something like this:

let runOnce = false;
grid.events.on("CellDblClick", function(row,column,e){ // or whatever event
    if(runOnce == true) {
        return false;
    } else {
        // your code
       runOnce = true;
}

And then, if you want to allow the grid event to run the event again if some action takes place run this function:
function resetRunOnce {
runOnce = false;
}

1 Like