PDA

View Full Version : Help In AfterEdit



DODOT
18 Jun 2008, 10:41 PM
Hi,

Can anyonw please help me?
I have problem to displaying the new modified value in the EditorGridPanel if I am using 'AfterEdit'.

Below are my sample code

grid.on('afteredit', function(e) {
var modRec = e.record;

//Avoid Duplicate Entry
var id1 = modRec.get('id');
var tempRec = new Array();
var ii = 0;

if (modRebDS.getCount() > 0){
for (var j=0; j < modRebDS.getCount(); j++){
var modRecInit = modRebDS.getAt(j);
var id2 = modRecInit.get('id');
if(id1 == id2){
tempRec[ii] =modRecInit;
ii++;
break;
}
}

if (tempRec.length > 0){
for (var p = 0; p < tempRec.length; p++){
modRebDS.remove(tempRec[p]);
}
}
}

modRebDS.add(modRec);
});

If I take out the last line, it working fine.
But If I put it the new value is not shown in the Grid.
Can somebody please explain why?

Thanks a lot for the help

gslender
18 Jun 2008, 11:36 PM
wrong forum - this GWT version of ExtJS only

DODOT
18 Jun 2008, 11:44 PM
Hi, Thanks for the info.. I am am new here :D