I have a Webdatagrid, I want to auto populate data for some cells when add new row.
eg.
var grid=$find(grid_Name);
//I add new row here
var newRow = grid.get_rows().get_row(grid.get_rows().get_length()-1); // I get a new row
newRow.get_cellByColumnKey("myCell").set_value(myValue); // myValue != null or empty
newRow.get_cellByColumnKey("myCell").set_text(myText); // myText != empty
When I used: newRow.get_cellByColumnKey("myCell").get_value();
I received empty value(or zero if column is number). But if I don't set_text, it work.
How can I get value from new row?
Thanks & Regards!
Hello,
Thank you for your post!
About your question, the approach that you follow is correct, but it depends on which event you try to get values. I have made you a sample that shows how to get old/new values (including number columns) after row is added to the WebDataGrid. If this is not helpful to you, please provide me with sample that is reproducing the issue.
Code snippet:
If you have any further questions do not hesitate to contact me.
Hello Zdravko Kolev,
Thanks for your reply.
When I press tab key (left focus status), I want to add a new row and auto populate data for some cells. This data get from cells of one row above.
function UWG_Editing_CellValueChanged(sender,e){
// I get & set value here
// My issue occurs when I set text (if not, It work fine)
}