Skip to content

Help with getting option "pageLoading" working #1442

@a95tbirdsc

Description

@a95tbirdsc

Could someone help me figure out how to get jsGrid to load my data. I'm using the "pageLoading" option but it would appear the controller is not wanting to recognize my data. What am I missing?

Data

[{"ROW_NUMBER":1,"data":"[{\"data\":[{\"STUDENTPIDM\":1,\"STUDENTID\":111,\"STUDENTNAME\":\"Presley, Elvis\",\"AIDYEAR\":\"2425\",\"CATEGORY\":\"Deceased\",\"CATEGORIES\":null,\"COMMENTS\":\"Wish he was still here\"},{\"STUDENTPIDM\":2,\"STUDENTID\":222,\"STUDENTNAME\":\"Monroe, Marilyn\",\"AIDYEAR\":\"2324\",\"CATEGORY\":\"Deceased\",\"CATEGORIES\":null,\"COMMENTS\":\"Really miss her.\"},{\"STUDENTPIDM\":3,\"STUDENTID\":333,\"STUDENTNAME\":\"Dean, James\",\"AIDYEAR\":\"2425\",\"CATEGORY\":\"Deceased\",\"CATEGORIES\":null,\"COMMENTS\":\"Cool Actor\"}],\"itemcount\":\"3\"}]"}]

Controller Code:


        controller: {
          loadData: function (filter) {
                      return fetch("/internal/VD.XXXX")
                               .then(response => response.json()) 
                               .catch((error) => {
                                  toastr["error"]("Something went wrong.", "Error");
                               });

Error:

Uncaught (in promise) TypeError: this.data is undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions