I'm using some JS similar to this to add a new row to my WebDataGrid:
grid = $find('WebDataGrid1'); // get a reference to the gridvalues = new Array(grid.get_columns().get_length()); // create a new empty rowgrid.get_rows().add(values) // add the new row
and it works great except that it ads the row to the bottom of the grid, and I want it to add to the top of the grid. Is there a way to do that?
Thanks,
Walter
Hi ssd,
We simply append a record to the DataSource. You have two options. You could either have a hidden sorted field that you use to place the new record first. It would just need a smaller int than the first previous row. Or you can do manual CRUD. Here, you would add it to the DataSource and it would be up to you to prepend it to the DataSource so that the grid displays the new data first.
regards,David Young
Hi David,
Thanks for the prompt response. You suggestion worked.
Thanks,Walter