I want to click add on the grid in inline mode.
New add row is added and I found the function afterInsertRow where I can do something.
But I dont have any idea how I can set default values on it depending on other columns.
for Example (after click on add):
3 Columns (1st Dropdown, 2nd Date, 3rd Text)
So if I press add I want to set default value on 3rd Column depending on selected entry on 1st Dropdown value)
So when I choose value 1 of Dropdown (1st column) I want to change value of the textbox (3rd column).
Is there any possibility to do so?
thx a lot, Gerhard
On first dropdown you can connect JS function on change event.
$col["editoptions"]["onchange"] = "update_field();"
and in html code:
var v = parseFloat(jQuery("select[name=dd1].FormElement, select[name=dd1].editable").val());
// custom logic to change dd2
jQuery("select[name=dd2].FormElement, select[name=dd2].editable").val( v );
where dd1 is dropdown to pick value and dd2 is which need to be changed.
helped me a lot.
Is it also possible to set min and max for the second field depending on first field?
Dropdown Value = 2
Textfield depends on Dropdownvalue 2 == min 0.2 max 1.4
or do I have to write this in js then?
thx a lot.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?