I use this code fragment to obtain the default VAT from the master grid and use it to select the equivalent VAT in the option select in the sub grid.
var rowid = $('#list1').getGridParam('selrow');
var vatDefault = $("#list1").jqGrid("getCell", rowid, "VatDefault");
$("#Vatcode option").filter(function() {
return $(this).text() == vatDefault;
}).prop('selected', true);
What kind of code I have to use for the inlineadd mode instead the add dialog mode?
Thanks in advance.
Massimo Gagliardi
I forgot:
to call the function I added this event:
$grid["add_options"]["afterShowForm"] =
'function(formid) {
setVatDefault();
….
You can use this selector for inlinemode:
jQuery('input[name="Vatcode"].editable')
Reference:
http://easycaptures.com/fs/uploaded/1017/9892108434.png
http://easycaptures.com/fs/uploaded/1017/9617668813.png
Plus, instead of afterShowForm, you can use:
$col["editoptions"]["dataInit"] = "function(){ setTimeout(function(){ ………………. },200); }";