...

View Full Version : Collapse Expand Inside textArea



ghtvnath
08-30-2010, 04:23 PM
i presently have a text area which is generated using two arrays.It is loaded at the screen load. It is as following.

var channelsGroups = new Array();
var channelsChildren = new Array();
channelsGroups[0]= new Array('Mars Public', 'MARS-PUB');
channelsChildren[0]=new Array();
channelsGroups[1]= new Array('Mars Private', 'MARS-PRIVA');
channelsChildren[1]=new Array();
channelsGroups[2]= new Array('Internet Booking Engine', 'IBE');
channelsChildren[2]=new Array();
channelsGroups[3]= new Array('mars Private Agent Specific', 'M-P-AGENT');
channelsChildren[3]=new Array();
channelsChildren[3][0]=new Array('AGT_002',' AGT_002 ');
channelsChildren[3][1]=new Array('CARLSON WAGONLIT AUSTRALIA PTY',' 235830 ');
channelsChildren[3][2]=new Array('Travel Zone',' TRAVELZONE ');
channelsChildren[3][3]=new Array('Worldlink Travels',' WORLDLINK ');
channelsChildren[3][4]=new Array('AAAAAAARFDS',' ADM2 ');
channelsChildren[3][5]=new Array('AAASSRet',' DMM3 ');
channelsChildren[3][6]=new Array('Adrian Travels',' DMM1 ');
channelsChildren[3][7]=new Array('Buraha Travels',' DMM2 ');
and more

Output in the textArea is as following
i presently have a text area which is generated using two arrays.It is loaded at the screen load. It is as following.

i presently have a text area which is generated using two arrays.It is loaded at the screen load. It is as following.

Mars Public
Mars Private
Internet Booking Engine
mars Private Agent Specific
-AGT_002
-CARLS...

I hope you inderstand the pattern. I want first to display only the groups(Mars Public, Mars Private) and when someone clicks on mars private Agent specific, the list of agents appear. There are other groups below agents and those groups also may have children.Those groups also should have the same on click functioanlity? Any Idea?

Thank you in advance...

DaveyErwin
08-30-2010, 07:49 PM
Pardon me for saying so, but
this is not an appropriate use
of a textarea, while it is possible
to accomplish this task it would be
much better to display your collapsible
list with an UL (unordered list)
which can be more easily expanded
and collapsed with javascript and/or
css

rnd me
08-31-2010, 12:31 AM
it can be done, but it's going to be quite a bit of code to accomplish the task. IE and FF handle textrea clicks/selections differently, so there's at least two copies of the same thing to write.

It would probably be much easier to use the textarea to show only the expanded text of whatever collapsed branch was active, perhaps using buttons to navigate.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum