문제

I have dhtmlXGridObject named mGrid.

I have attached validation event:

mGrid.attachEvent("onEditCell", function(stage, rId, cInd, nValue, oValue){...});

Also I have save button:

<input type="button" value="Save" onClick="onSaveClick();" />

All works fine except one situation: If I edit the data and leaving the cursor in the cell and click "Save" then the method "onSaveClick" is called first and only then "onEditCell" is called.

How can I perform calling "onEditCell" before "onSaveClick"?

도움이 되었습니까?

해결책

This should do the trick:

Try closing the cell-editor first in your onSaveClick() function. This will trigger the onEditCell event.

function onSaveClick(){
    mGrid.editStop();

    //Your code...
}

Dhtmlx documentation editStop

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top