I have the following code:
mygrid.attachEvent(“onEditCell”,function(stage,id,ind){
if(stage==2){
if(ind ==0){
for(var i=0;i<=(mygrid.getRowsNum()-2) ;i++){
if(mygrid.cells(id,0).getValue() == mygrid.cells2(i,0).getValue()){
alert(“Duplicates not allowed”);
}}}
The column at index 0 is a coro type. When i degug the above code mygrid.cells(id,0).getValue() returns the value of the coro whereas mygrid.cells2(i,0).getValue() returns the text of the coro. Iam expecting both mygrid.cells(id,0).getValue() and mygrid.cells2(i,0).getValue() to return the values. What am I doing wrong?
Actually the both command grid.cells and grid.cells2 returns the same object, so getValue must work exactly the same and returns always values ( not labels )
When loading initial data from XML do you have a values or a labels as a data?
mygrid.getCombo(0).put(“1”,“One”)
1 // => will be rendered as One with value 1
One // => will be rendered as One with value One