Nativeeditor_status always "inserted" after one insert

Hello,

function onLoadGrid(){
        grid = new dhtmlXGridObject('gridbox');
        initGrid("/MRoad/web/js/dhtmlxSuite/dhtmlx_pro_full/imgs/", "/mroad/web/app.php/modele/grid-modele-groupe");
        dp = new dataProcessor("/mroad/web/app.php/modele/action-dhtmlx/AmsModeleBundle:GroupeTournee");
        initDataProcessor();
    }

function initGrid(dhtmlx_img, path, selectedRowId) {
    grid.setImagePath(dhtmlx_img);
    grid.setSkin("dhx_skyblue");
    grid.enableEditEvents(true, false, false);
    grid.enableUndoRedo();

    grid.init();

    grid.loadXML(path,
            function() {
                if (selectedRowId)
                    grid.selectRowById(selectedRowId);
            }
    );
}
function initDataProcessor() {
    dp.setTransactionMode("POST");
    dp.enableDataNames(true);
    dp.setUpdateMode("row");

    dp.attachEvent("onAfterUpdate", function(id, action, tid, tag) {
        return onAfterUpdateDataProcessor(id, action, tid, tag);
    });
    dp.init(grid);
}

function onAfterUpdateDataProcessor(id, action, tid, tag) {
    switch (action) {
        case "insert":
//            dp.setUpdated(0,false);
//            dp.setUpdated(tid,true);
            break;
        case "update":
            if (tid) {
//                dp.setUpdated(id, false);
                grid.changeRowId(id, tid);
            }
            break;
        case "delete":
            if (tid) {
//                dp.setUpdated(id, false);
                grid.changeRowId(id, tid);
            }
            break;
        case "error":
            break;
            dp.setUpdated(id);
    }
    return true; 
}
function addRow(id) {
    grid.addRow(0, initRow, 0);
    grid.selectRowById(0);
}

After a row is inserted, when i update or delete another row, !nativeeditor_status is always equal to “inserted”.
If i uncomment dp.setUpdated(0,false); in onAfterUpdateDataProcessor(action=“insert”), !nativeeditor_status is blank.

What is wrong ?

Please be sure that code in onAfterUpdateDataProcessor doesn’t throw JS error ( changeRowId call in the “delete” callback is quite suspicious ).

Normally state of row must be changed after processing the callback. If callback is not processed, the row will stay with inserted status.

Also, if you have “error” or “invalid” action type in response for the inserted row, it will be marked as not saved and during next data saving operation will be sent to server again, with “inserted” status

I’ve changed 0 with grid.uid() in addRow, like this

function addRow() { rowIdInserted=grid.uid(); grid.addRow(rowIdInserted, initRow, 0); grid.selectRowById(rowIdInserted); }

And everythink is ok.
Very strange !!!

Yep, using 0, false, or null as row ID can lead to strange effects