KendoDropDown for Support Group on Custom Task only populating with items 50% of the time
Hello Community,
My job doesn't require a lot of web development/javascript so I am having a hard time finding my error. I extended the Add Manual Activity custom task to have a few more fields and it works 100% some of the time, its almost as if it only works after a browser cache clear and a page refresh. I can't ask my techs to do this every time obviously so any help would be greatly appreciated
Just to clarify the only issue is with the support groups drop down not having items from the binded dataSource when clicking the task sometimes. Other times it works flawlessly.
Best Answer
-
Konstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭My guess would be, that the async AJAX call is to blame, as you can't be sure, that all the data is returned before you start processing it. You could set
async: false
on the call or you could utilizedone()
and process your data there, e.g.:<br>// Get MA support groups<br>(function() {<br> return $.getJSON("/api/V3/Enum/GetList", {<br> Id: MASupportGroupEnumGuid<br> });<br><br>})().done(function(json) {<br> $.each(json, function(key, val) {<br> supportgroupz[key] = val;<br> });<br><br> // Remove mysterious 'undefined' entries<br> supportgroupz = supportgroupz.filter(function(n){ return n != undefined });<br>});
1
Answers
async: false
on the call or you could utilizedone()
and process your data there, e.g.: