I have a grid with values ​​of currency, payments at maturity, which may not exceed the amount of the invoice to which they relate.
Is it possible to read the total amount invoice (which is another record) and set this value as the default value the amount of the payment at maturity?
Thanks in advance
If i understand the issue correctly. you will need to use on_data_display event handler and set the desired value to that column (after querying another record).
Refer demos/editing/custom-events.php for on_data_display usage.
I would populate fields in the add/edit dialog not in the inline edit.
Is this possible?
Answer is pretty late, but one solution could be to bind afterShowForm event with a JS function and do an ajax call to retrieve values.
$grid["add_options"]["afterShowForm"] = 'function(formid) {
// ajax call to load and fill data;
// set value in field using jQuery, usually field name will be ID of input tag e.g. set 123 in date field
jQuery("#date").val('123');
}';
In same way, you can connect:
$grid["edit_options"]["afterShowForm"] = '…';
$g->set_options($grid);