Loading jsGrid by calling Controller/WebService in MVC

You should use promises while loading data,

loadData: function(filter) {

  return $.ajax({
        type: "GET",
        url: "../Common/GetData",
        data: filter,
        dataType: "JSON"
    })

}

return $.ajax({}) does return a Promise. thank you


I too was having problems with JSGrid. I was using the following snippet (as some have suggested):

`

loadData:   function(filter) {
    console.log("LoadData called....")
    var d = $.Deferred();
    $.ajax({
      type: "GET",
      url: "/secure/msgitems",
      data: filter
    }).done(function(response) {
      console.log(  response);
      d.resolve(response);
      return;
  });
 return d.promise();
 },
},

`

I could see the results coming back, but my jsGrid kept puking. It turns out the server must return the data in the following format:

{
data: [items], itemsCount: amountOfItems }

Here is where the developer discusses this topic: https://github.com/tabalinas/jsgrid/issues/35

It seems to work...FWIW