Add dialog mode VS inlineadd mode – set selected option

QuestionsAdd dialog mode VS inlineadd mode – set selected option
Massimo Gagliardi asked 9 years ago

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

3 Answers
Massimo Gagliardi answered 9 years ago

I forgot:
to call the function I added this event:

$grid["add_options"]["afterShowForm"] =
'function(formid) {
setVatDefault();
….

Abu Ghufran answered 9 years ago

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); }";

Massimo Gagliardi answered 9 years ago

Perfect!
Thank you very much

Your Answer

18 + 3 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?