Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

changing the image in the listgrid field while editing the row

$
0
0
Hello All,

I need to have an image in a listgrid field and once the row is edited I need to replace it with another image, to do that I wrote the following code

Code:


isc.ListGrid.create({
{name:"formIcon", canFilter:false,canSort:false,  title:" ", type: "Icon", imageURLPrefix:"${imgLoc}/", imageURLSuffix:".png", valueIcons:{'undefined':'grid-form-popup','1':'discard_edit'} , width:"23",canDragResize:false,canEdit:false},


,editorExit: function(editCompletionEvent,record,newValue,rowNum,colNum){
                if(record!=undefined && record!=null){
                        record.formIcon="undefined";
                        this.refreshRow(rowNum);
        }
        },
editorEnter:function(record, value, rowNum, colNum){
       
                if(record!=undefined && record!=null){
                            record.formIcon="1";
                    this.refreshRow(rowNum);
            }
}

}       
);

my question is there any other way to do the same thing as I feel this code is not straight forward and can be error-prone in some cases, It would be great if you can send me sample code for alternative solution

Viewing all articles
Browse latest Browse all 4756

Trending Articles