IT Monkey:   Click Here to Help Me Build the Agenda for Upcoming Cireson Webinars!

KendoDropDown for Support Group on Custom Task only populating with items 50% of the time

Davin_ClouthierDavin_Clouthier Customer Adept IT Monkey ✭✭
edited September 2017 in Analyst Portal

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-BoKonstantin_Slavin-Bo Customer Advanced IT Monkey ✭✭✭
    edited September 2017 Accepted Answer
    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 utilize done() and process your data there, e.g.:

    // Get MA support groups
    (function() {
      return $.getJSON("/api/V3/Enum/GetList", {
        Id: MASupportGroupEnumGuid
      });

    })().done(function(json) {
      $.each(json, function(key, val) {
        supportgroupz[key] = val;
      });

      // Remove mysterious 'undefined' entries
      supportgroupz = supportgroupz.filter(function(n){ return n != undefined });
    });

Answers

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Advanced IT Monkey ✭✭✭
    edited September 2017 Accepted Answer
    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 utilize done() and process your data there, e.g.:

    // Get MA support groups
    (function() {
      return $.getJSON("/api/V3/Enum/GetList", {
        Id: MASupportGroupEnumGuid
      });

    })().done(function(json) {
      $.each(json, function(key, val) {
        supportgroupz[key] = val;
      });

      // Remove mysterious 'undefined' entries
      supportgroupz = supportgroupz.filter(function(n){ return n != undefined });
    });

  • Davin_ClouthierDavin_Clouthier Customer Adept IT Monkey ✭✭
    Thanks that was exactly the issue, I flipped a few functions to syncronous and changed up a few things and she works 100% now. Much appreciated Konstantin_slavin-Bo
  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Advanced IT Monkey ✭✭✭
    Thanks that was exactly the issue, I flipped a few functions to syncronous and changed up a few things and she works 100% now. Much appreciated Konstantin_slavin-Bo
    No problem, happy to help!
Sign In or Register to comment.