dgMyGrid.selectedItem.UploadFileName = "myFile.jpg";
The custom property in this case is the UploadFileName. Also note that the data object, which would contain the row's values, is out of scope here. Perhaps this is because we're calling the function from inside the itemRenderer. So instead, we use the datagrid. However, the data object has that custom field set anyway so it can be accessed from the itemRenderer.
Then in the itemRenderer, we override the set data function,
override public function set data(value:Object):void {
super.data = value;
if (data.UploadFileName == undefined){
txtPhoto.text = "";
}
else {
if(data.UploadFileName == null || data.UploadFileName == ""){
txtPhoto.text = "";
}
else {
txtPhoto.text = data.UploadFileName;
}
}
}
super.data = value;
if (data.UploadFileName == undefined){
txtPhoto.text = "";
}
else {
if(data.UploadFileName == null || data.UploadFileName == ""){
txtPhoto.text = "";
}
else {
txtPhoto.text = data.UploadFileName;
}
}
}
No comments:
Post a Comment