2017-06-19 56 views
0

我越來越沒有定義用戶數據:的jqGrid - 用戶數據不確定

var userdata = $('#case_grid').getGridParam('userData'); 
    if (userdata) { 
    alert(userdata.consultations); 

具有以下JSON輸出:

{"page":"1","total":"1","records":"1","userdata":{"consultations":"3"},"rows":[{"user_id":"00082563","name":"Peter Browne","case_title":"Male with STI (urethritis)","case_started":"2017-06-16 14:53:47","status":"Completed"}]} 

回答

0

只是改變一下代碼,並得到了其與這方面的工作:

loadComplete: function() { 
      var userdata = $('#case_grid').getGridParam('userData'); 
      if (userdata) { 
      var consultations = userdata.consultations; 
      } 
       },