EasyUI Forum
April 19, 2024, 05:03:59 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Reload TreeGrid not updating grid  (Read 9309 times)
btork
Newbie
*
Posts: 8


View Profile
« on: November 05, 2016, 06:51:06 AM »

I'm trying to reload all the data in the TreeGrid with a button. I can see from the network console that it's retrieving the json data and the grid flashes, but the data isn't updating.

Here's my javascript function:
           function reloadAll(){
                       $('#tt').treegrid('reload');
           }

<a href="javascript:void(0)" class="easyui-linkbutton" onclick="reloadAll()">Reload</a>


<table id="tt" class="easyui-treegrid" style="width:100%;height:550px;"
         url="leaderboarddata.php?tourney=<?php echo $_GET['tourney'] ?>"
         rownumbers="false"
         idField="scorecardid" treeField="name"
         data-options="onClickCell:function(field,row){
          if (field == 'name'){
              $(this).treegrid('toggle', row.scorecardid);
          }
         }">

Thanks,
Brian
« Last Edit: November 05, 2016, 07:43:43 AM by btork » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: November 05, 2016, 11:45:16 PM »

Please look at the network console, Is the returning data from server correct after calling the reload method.
Logged
btork
Newbie
*
Posts: 8


View Profile
« Reply #2 on: November 06, 2016, 06:51:47 AM »

Yes, the data is correct in the network console, but the grid doesn't update.
Logged
btork
Newbie
*
Posts: 8


View Profile
« Reply #3 on: November 06, 2016, 07:06:39 AM »

Do I need to rebind the data to the table after I call Reload? I'm stumped here why this isn't updating.
Logged
btork
Newbie
*
Posts: 8


View Profile
« Reply #4 on: November 06, 2016, 10:05:21 AM »

Can anyone post an example of a treegrid that works with the Reload method?
Logged
btork
Newbie
*
Posts: 8


View Profile
« Reply #5 on: November 07, 2016, 11:10:26 AM »

I figured out that my issue was a data problem. My children records did not have the id field populated. This caused an issue when the reload method attempted to repopulate the data in the grid.

Hope that can help someone in the future.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!