Hi
Is it somehow possible to set the values of the last row that was added as default values for the add row dialog.
Thanks
Alex
Hello,
You will need some extra JS coding in afterShowForm event.
$opt["add_options"]["afterShowForm"] = 'function() { fill_add_form(); }';
..
$g->set_options($opt);
In this callback, you can read the values of last row of grid, e.g.
<script>
function fill_add_form()
{
// get all rows as array
var rows = $('#list1').getRowData();
// Now this last_row contains the object of last displayed row of grid. (not the last page's last row)
var last_row = rows[rows.length-1];
// Use jquery to set input fields data according to last_row object
jQuery("input[name=gender]").val( last_row.gender );
}
</script>
You can fill other rows in same manner.