Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Alejomj on Mar 02, 2009 16:49
open dhtmlx forum
addrow isue with Dataprocessor

Hi, I have a problem when I use the manual update in dapaprocessor, I add a userdata value in a specific row and then I mark it updated :

    setUserData(idSource,'rank',rank_a);
    myDataProcessor.setUpdated(idSource,true);
sortRows(0);
it owrks fine, but when I add a new row the mark it how new record (bold) doesnt work

function add_new_RHS (z) {
with(RHSmygrid) {
var new_row_id =(!z?'s_':'')+(new Date()).valueOf()+getRowsNum()+Math.random();
addRow(new_row_id,'[Type Name Here]','',z,(!z?'1.png':(2+Math.round(3*Math.random()))+".png"));
if(!z) setUserData(new_row_id,'rank',9999);


I try adding the:     myDataProcessor.setUpdated(new_row_id,true); but the status sent to the server is same update.

Thx
Answer posted by Support on Mar 03, 2009 05:24
In current version setUpdated always set status to "updated" ( will be resolved in oncoming version, which has more flexible approach ) 
In current version you can try to use 

myDataProcessor.setUpdated(new_row_id);
mygrid.setUserData(new_row_id,"!nativeeditor_status","inserted");

By the way, if dataprocessor attached to the grid, it must automatically assign "inserted" status to any newly created row. 
Answer posted by Alejo on Mar 03, 2009 05:35
Hi thx for your fast reply I solved the problem,

I had the setUserdata into onDrag event, I changed it for onDragIn event and it worked perfectly

Thx, your product is very excellent