About Webix list has error when return "total_count" from Server-side Response

edited November 2018 in Technical questions

TypeError: undefined is not an object (evaluating 't.id')

{
    view: "list",
    select: true,
    multiselect: true,
    datafetch: 5,
    navigation: true,
    url: "***url***"
}

return json

{
  "total_count": 21,
  "data": 
  [
    {
      "id": 19,
      "name": "issue",
      "type": "Issues",
      "reporter_id": 11,
      "reporter_name": "Chirapon",
      "status": "OPEN"
    },
    {
      "id": 20,
      "name": "add transient",
      "type": "Issues",
      "reporter_id": 11,
      "reporter_name": "Chirapon",
      "status": "OPEN"
    },
    {
      "id": 16,
      "name": "assign me",
      "type": "Work Order",
      "reporter_id": 11,
      "reporter_name": "Chirapon",
      "status": "OPEN"
    },
    {
      "id": 21,
      "name": "test",
      "type": "Work Order",
      "reporter_id": 11,
      "reporter_name": "Chirapon",
      "status": "OPEN"
    },
    {
      "id": 10,
      "name": "noti",
      "type": "Work Order",
      "reporter_id": 11,
      "reporter_name": "Chirapon",
      "status": "OPEN"
    }
  ],
  "pos": 0
}

and how to make auto load when scrolling to bottom like datable

Tagged:

Comments

  • Hello,

    For ui.list, dynamic loading is an additional feature which is disabled in default settings. To enable it, please set property dynamic to true, as mentioned in the related docs.

  • edited February 15

    Hi Listopad,

    I got empty list when I set properties

    type: { height: "auto" }

    Please let me know about how to set height: auto for my list?

  • {
        view: "dataview",
        datafetch: 20,
        navigation: true,
        xCount: 1,
        template: obj => {
            return `<div>
                <span style="">
                    <b>${obj.updateBy}</b> updated the 
                    <b>${_.startCase(obj.name).replace(/([A-Z])/g, " $1").trim()}</b>
                </span>
                <span class="" style="display: block;">
                    <span style="color: #bdc3c7;">${obj.oldValue || "None"}</span>
                    <i class="mdi mdi-arrow-right" style="margin: 5px 5px;"></i>${obj.newValue || "None"}
                </span>
                <span style="display: block; font-size: 10px; color: #2980b9;">${util.renderMomentDate(moment(obj.updateTime.iso, "YYYY-MM-DDTh:mm:ssZ"))}</span>
                </div>`;
        },
        type: {
            height: "auto",
            width: "500",
        },
        data: [],
        on: {
            onAfterLoad: function () {
                if (this.count()) {
                    this.hideOverlay();
                }
            }
        },
        ready: function (obj) {
            if (!this.count()) {
                webix.extend(this, webix.OverlayBox);
                this.showOverlay(`<div style="margin:20px; font-size:14px;">None Activity</div>`);
            }
    
        }
    }
    
  • Sorry I change view "list" to "dataview"

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!