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
I'm just checking if you have resolved your issue.
Hello,
Thank you for the sample!
After further investigation I have found the problem. Currently is not possible to set active cell to row that does not exists yet. You need to wait until the Ajax is performed, and then set the desired cell in edit mode. I accomplish this by setting a little timeout in order to wait to add the new row and then set the cell in edit mode. See the code snipped:
My suggestion is to use enterEditMode(cell). I have made changes to your project, and hope you will like my approach.
If you have any further questions, please do not hesitate to contact me!
Hi Zdravko Kolev,
I attached an example for you.
Thanks & Regards
I'm just following up to see if you need any further assistance with this issue. If so do not hesitate to contact me.
Could you please make changes to the sample that I send to you on the previous post, in order to reproduce the issue, and send it back to me, so I can investigate it further for you.
Looking forward to hearing from you.