EasyUI Forum
May 30, 2024, 05:39:35 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: TreeGrid : appending a row doesn't correctly apply striping  (Read 10836 times)
itay-g
Newbie
*
Posts: 35


View Profile
« on: June 23, 2014, 12:47:12 AM »

Hello.

I am appending (using the append method on the treegrid of course) a row to a treegrid with striped : true, but no matter how many rows I append non of them get the "alt" striped display, and all of them are added as the default row style.
Is this intentional?


Thank you.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 23, 2014, 08:11:18 PM »

Please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.3.6-patch.zip
Logged
itay-g
Newbie
*
Posts: 35


View Profile
« Reply #2 on: July 06, 2014, 07:26:17 AM »

Hey,

I have tried applying the patch and it doesn't seem to work exactly. Only if I refresh the entire data of the grid and the render method is invoked for all the elements then the new style is applied.
It seems when one row is being appended only that row and its children are sent to the render function and then only they are calculated for the coloring, which results in that the root rows never receive the "alt" look.

Thanks again.
Logged
itay-g
Newbie
*
Posts: 35


View Profile
« Reply #3 on: July 16, 2014, 11:04:10 PM »

Help?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: July 18, 2014, 01:45:30 AM »

Please refer to this example http://jsfiddle.net/5HUgU/. It works fine.
Make sure you have applied the newest patch file in your page. It can be downloaded from http://www.jeasyui.com/download/downloads/jquery-easyui-1.3.6-patch.zip
Logged
itay-g
Newbie
*
Posts: 35


View Profile
« Reply #5 on: July 20, 2014, 01:00:32 AM »

Hello,
I don't really understand what happened but on the patch I downloaded at the time instead of this row (which exists on the patch now) :
var index = (pnode ? pnode.children.length : $(target).treegrid('getRoots').length) - children.length;

I have this row:
var index = (pnode ? pnode.children.length - children.length : 0;

Now that I have re-downloaded the patch it works fine. Thank you!
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!