This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12018|Reply: 0

[EasyUI] EasyUI datagrid empty data

[Copy link]
Posted on 10/29/2015 5:11:33 PM | | |
First of all, the code:

  1. onBeforeLoad: function (param) {
  2.                                     var contuine = true;
  3.                                     $.post("/BoardRoom/GetJoinBoardRoomUser/", "id=" + rec.id, function (rpsData) {
  4.                                         if (rpsData.Msg == "Error") {
  5.                                             $('#userinfo').datagrid('loadData', { total: 0, rows: [] });
  6.                                             contuine = false;
  7.                                         }

  8.                                         return contuine;
  9.                                     });
  10.                                 }
Copy code
onBeforeLoad param is triggered before loading the request data and terminates the load data operation if false is returned.

$('#userinfo').datagrid('loadData', { total: 0, rows: [] });  This is the code to empty the data:

Before loading the data, we judge whether the data is the data we want, and then choose whether to load it.




Previous:Turn off the Browser Link feature in Visual Studio 2013
Next:C# generates random numbers
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com