JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CoolJSTreePro: CheckBox on a Node

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree
Author Message
Tshaik



Joined: 17 Jun 2004
Posts: 4

PostPosted: Wed Jun 07, 2006 9:46 pm    Post subject: CoolJSTreePro: CheckBox on a Node Reply with quote

Help...

I have CoolJSTreePro Version 2.7.0, Is it Possible to have a Check Box on a Node. Or is there any other way to have more than one node selected at a time?

Thanks.
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Jun 07, 2006 11:36 pm    Post subject: Reply with quote

No, currently there is no way to have more than one item selected.

To insert checkbox, you can try something like this:

Code:
[ '</a><input type="checkbox" />My caption<a>', null, null],
Back to top
Tshaik



Joined: 17 Jun 2004
Posts: 4

PostPosted: Wed Jul 05, 2006 2:50 pm    Post subject: Reply with quote

Thanks, That Works. I have one more question...

Iam going to have check boxes on all my nodes...I have a Submit button , when the user clicks the Submit button I need to get the values of all CHECKED nodes and submit them. How Can I do this... Anyhelp would be greatly Appreciated.

In other words what I am trying to do is... I am going to Present the Account Numbers in a tree format(each node is an Account Number) each node on expansion has details about the Accuont number presented in a form, the user needs to select the account numberS (nodes) and submit them for further processing. can somebody suggest if there is a better way of doing this...

This is really important for me any help would be greatly appreciated.

Thanks.
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Jul 12, 2006 9:49 am    Post subject: Reply with quote

What about stepping on every node with getNumberOfChildren, getChild and getId methods? You can use node's ID as a name for checkbox.
Back to top
Tshaik



Joined: 17 Jun 2004
Posts: 4

PostPosted: Wed Jul 12, 2006 2:54 pm    Post subject: Reply with quote

Can you please Explain it with an Example,When I tried to give the check box a name and use that name in my javascript to validate it it does not even recognize the check box.

Please if you can compile a simple example that would really help.

Thanks in Advance.
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Thu Aug 17, 2006 8:43 am    Post subject: Reply with quote

The tree has dynamic nature, and it creates nodes only on demand. So, your checkbox does not exists if its tree node is not visible.

By using getNumberOfChildren() and getChild() recursively you emerge every item into existense, and all checkboxes will be created also.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree All times are GMT
Page 1 of 1