tabalinas / jsgrid

Lightweight Grid jQuery Plugin
http://js-grid.com
MIT License
1.52k stars 352 forks source link

grid is not refreshing after deleting the only item #1350

Open olehdutko opened 4 years ago

olehdutko commented 4 years ago

Firstly, I want to say "thanks" for a really good, flexible and powerful grid!

screenshot: https://prnt.sc/tfvjuj

I have the following problem: After removing the only item from grid, item is still in grid. If I have more than 1 item, it disappears after deleting without any problem. In case I delete the only item - only browser refresh can halp me.

I call " $("#jsGrid4").jsGrid("loadData");" after each deleting to refresh grid After deleting the only grid item I have the next response that I am trying to load to the grid (from getCustomQuiz.php'): {"result":"Success","data":null}

Here is my controller code:

controller: { loadData: function() { var d = $.Deferred(); $.ajax({ url: './php/getCustomQuiz.php', type: "GET", data: { ssid: Get_Cookie('SessionID') }, success: function(response) { json = JSON.parse(response); } }).done(function(response) { d.resolve(json.data); }); return d.promise(); }, },