Issues with dropdown list if you use the inline edit

QuestionsIssues with dropdown list if you use the inline edit
Massimo Gagliardi asked 9 years ago

Hi Abu
I noted that if you use the inline edit and you have some fields with dropdown lists (from database) the dropdown list doesn't show the choise active but seems behave how was an add action, with the dropdown list without any selection.
However the tooltip of the dropdown shows the choise active.
Then I used the below script:

$col["editoptions"]["dataInit"] = "function(){ setTimeout(function(){setVatDefault();},200); }";

function setVatDefault() {
var vatDefault = $("td[aria-describedby='list2_IDCodiceVat']").attr('title');
if (vatDefault == "undefined") {
var rowid = $('#list1').getGridParam('selrow');
var ifVat = $("#list1").jqGrid("getCell", rowid, "ID4");
if (ifVat != 0)
vatDefault = $("#list1").jqGrid("getCell", rowid, "VatDefault");
else
vatDefault = '';
}
$('#list2 select[name="IDCodiceVat"] option').filter(function() {
return $(this).text() == vatDefault;
}).prop('selected', true);
}

Can you suggest me a better way?
Thanks in advance
Massimo Gagliardi

Your Answer

1 + 16 =

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?