Add new jquery kanban item with the name and text

352 Views Asked by At

My kanban is composed of 2 columns, and each column has several items (representing task) : taskId on the top, and task name on the bottom part of the item. I have selected task from database (taskId and taskName). An ajax query slect the task from the database and the response is the new list of task. This list is a json. I set this json to the localData of my kanban source. The role is displayed in the item, but instead of having is name, nothing is displayed.

  $.ajax({
    url: "/Task/viewTask",
    contentType: "application/json; charset=utf-8",
    type: "POST", dataType: "json",
    data: JSON.stringify({ employeeId: empId }),
    success: function (data) {
      var selectedmaper = null;
       for (var i = 0; i < colMapper.length; i++) {
           if (colMapper[i].empID == empId) {
               selectedmaper = colMapper[i];
               break;
           }

       }
       for (var i = 0; i < data.length; i++) {
           debugger;

           var taskName = (data[i].taskId).toString();
           resourcesSourceData.push({ id: data[i].taskId, name: taskName });
           var resourceId = data[i].taskId;
           $('#kanban1').jqxKanban('addItem', { status: selectedmaper.autoID, text: data[i].description, tags: "task", color: "#5dc3f0", resourceId: resourceId });

       }


    }

https://i.stack.imgur.com/Wed3e.png

0

There are 0 best solutions below