Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Get inserted row using Javascript
posted

I am adding a row, using: WebHierarchicalDataGrid1.get_rows().add(dataArray)


The row is being saved from a Single Record View that I developed. The requirement is that after the row is added, the person continues to work on the same row. However, I haven't figured out how to get reference to that newly added/inserted row, in order to make changes to its values. Also, I have paging enabled, so I can't just take the last row, because it gives me the last row on the first page, which doesn't help me if I have more than one page. But I had a few ideas.

 - Does the add(dataArray) return any values? For example, if it could return the added row, that would be great.

- Could I disable paging for the grid from javascript, then get the last row, and enable paging again?

- I also tried <ig:EditingCore EditingClientEvents-RowAdded="WebHierarchicalDataGrid1_RowAdded">, but WebHierarchicalDataGrid1_RowAdded is not called at all for some reason. Just in case, I have a server eventhandler for rowadded too.

- Another method, I thought would do it, is to change the selected page from javascript, and then retrieve the last row on the page. Is that possible?

- Finally, if I don't find answers to these questions I'd probably just update the datasource itself instead of going through the grid CSOM.

I would highly appreciate your answer to these questions and a recommended way to handle my problem!

Thank you,

Arman