Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Richard White on Sep 28, 2007 00:26
open dhtmlx forum
OnEditCell Problem

Hi, this is a very frustrating problem and id be grateful of your help.

i have a coro column type which if clicked changes to the value that you select in the list. however if i add the following line of code the value goes back to the start of the drop down list and the values will not change to what you select

mygrid.attachEvent("onEditCell",function(stage,rowid,cellIndex){
if (stage==2){
//edit finished
//any custom code here
}
});

this is all the code i have added for it to not change. i have tried inserting he newValue into the paramters and doing a setValue and it doesnt work at all:

mygrid.attachEvent("onEditCell",function onEditCell(stage,rowId,cellId,newvalue)
    {
    
if(cellId == 1 && stage == 2)
     {
    
     mygrid.cells(rowId, 1).setValue(parseInt(newvalue));
    }
    } );


i would be extremely grateful for any help

thanks
Answer posted by Stanislav on Sep 28, 2007 10:16
onEditCell must have
    return true;
to confirm edit operation
Answer posted by Richard White on Sep 28, 2007 12:58
Hi,

Thanks for your reply it is now working fine.

However, as you said this is common that people would want to use it in this manner yet i have found no examples in any of your documentation that tells me that it needs return true. So how would i or anyone else know to do this.

Am I missing some documentation? I have noticed that you don't have examples of much of your code. in the reference guide in your documentation it says oneditcell but it doesnt give any sort of examples

llike i said, am i missing any documentation, if not then are you planning any more detailed documentation to be released soon?
Answer posted on Sep 28, 2007 15:34
I agree, this is our miss, the documentation has remark that return false block event , but it doesn't clearly state that return nothing is equal to return false.
We will update documentation with oncoming build release.

Meanwhile this rule " absense of return equal to return false; " works for all events in grid.
Answer posted by Richard White on Sep 28, 2007 16:17
OK Thanks