[ 6 posts ]

Kai Schwarz

  • Username: papakai
  • Joined: Fri Nov 13, 2009 8:26 am
  • Posts: 301
  • Location: Germany
  • Offline
  • Profile

nested Headers & Table Options dialogue (show/hide)

Post Posted: Mon Nov 16, 2009 5:58 am
+0-
with nested Headers this dialogue doesnt work for show & hide. Is there any solution for this?
I just found via google hints that it wont work, but perhaps theres something actually changed?

many thanks
Kai

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: nested Headers & Table Options dialogue (show/hide)

Post Posted: Mon Nov 16, 2009 9:49 am
+0-
The last paragraph in: http://developer.yahoo.com/yui/datatable/#nest says:

"Please note that not all feature are compatible with nested Columns. Specifically, Columns that have children can not be resized, and Columns that are children can neither be hidden/shown nor dragged-and-dropped."

Kai Schwarz

  • Username: papakai
  • Joined: Fri Nov 13, 2009 8:26 am
  • Posts: 301
  • Location: Germany
  • Offline
  • Profile

Re: nested Headers & Table Options dialogue (show/hide)

Post Posted: Mon Nov 16, 2009 11:12 pm
+0-
Hey Satyam,

thanks for your reply and further thanks for all your work. I read many articles of you about yui and you helped me a lot getting started.

For everyone, who is interested in my solution for showing / hiding:
In some scenarios it makes sense to display only the parent columns in the show/hide dialogue (group hide/show). You can simply find them by using:
Code:
parentNodes = this.getColumnSet().tree;
parentNodes = parentNodes[0];


To show/hide such a complete column-group, just get now recursivly all their column childnodes of the table header and put their key-name in an array.
To change visibility then use:
Code:
:
YAHOO.util.Dom.get('yui-dt0-th-' + cols[i]).style.display = visibility;
:


Now we just have to hide all nodes of the table body.
Loop over your array and get all elements with classname "yui-dt0-col-" + col-key:
Code:
:
elements = document.getElementsByClassName('yui-dt0-col-' + ncols[i]),
len = elements.length;
for (var a=0; a<len.length; a++){
    elements[a].style.display = visibility;
}
:


Visibility should be 'none' or '' for hide / show.

I dont think that this is the bettest solution, but a certain way...
So any comments are welcome for discussion :-)

Regards
Kai

Giam Teck Choon

  • Username: choon
  • Joined: Thu May 06, 2010 12:51 pm
  • Posts: 3
  • Offline
  • Profile
Tags:

Re: nested Headers & Table Options dialogue (show/hide)

Post Posted: Wed May 12, 2010 11:45 am
+0-
Hi Kai,

Sorry, I know this post/thread is dated last year but this is the most related topic about hiding/showing nested columns as YUI 2.8.1 still does not support hiding/showing nested columns :(

I read about your posting at http://yuilibrary.com/projects/yui2/ticket/2528863 and wonder how you add an adapter class for datatable. Any example would be great :)

Thanks.

Kindest regards,
Choon

Giam Teck Choon

  • Username: choon
  • Joined: Thu May 06, 2010 12:51 pm
  • Posts: 3
  • Offline
  • Profile

Re: nested Headers & Table Options dialogue (show/hide)

Post Posted: Thu May 13, 2010 9:56 am
+0-
Hi Kai,

It is fine now. I have figured out how to do the nested hiding/showing not using your method. In fact, yui2.8.0r4 has partial support for nested hiding/showing just not fully. I tested 1 level child with nested headers defined with key/label pairs worked out fine. 2 levels depth only work partially... can't hide all columns under parent column.

Thanks.

Kindest regards,
Choon

Kai Schwarz

  • Username: papakai
  • Joined: Fri Nov 13, 2009 8:26 am
  • Posts: 301
  • Location: Germany
  • Offline
  • Profile

Re: nested Headers & Table Options dialogue (show/hide)

Post Posted: Wed Aug 17, 2011 11:14 pm
+0-
just to complete this topic:
--> http://yuilibrary.com/projects/yui2/ticket/2529483

I fixed that problem.
  [ 6 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum