HighDots Forums  

(treeview) Collapsable hitarea

jQuery jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.


Discuss (treeview) Collapsable hitarea in the jQuery forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ryan
 
Posts: n/a

Default (treeview) Collapsable hitarea - 11-04-2009 , 02:43 PM






I have a treeview in my application and all works pretty well with it.
I want the toggle +/- button to work as it does by default, but want
the rest of the node to not trigger the collapse/expand event. How
would one go about preventing this behavior? I've checked the other
threads that are similar to my question but didn't get any answers
that actually worked.

Thanks,
Ryan

Reply With Quote
  #2  
Old   
Ryan
 
Posts: n/a

Default Re: (treeview) Collapsable hitarea - 11-11-2009 , 03:30 PM






Anyone?

On Nov 4, 1:43*pm, Ryan <grigg... (AT) gmail (DOT) com> wrote:
Quote:
I have atreeviewin my application and all works pretty well with it.
I want the toggle +/- button to work as it does by default, but want
the rest of the node to not trigger the collapse/expand event. How
would one go about preventing this behavior? I've checked the other
threads that are similar to my question but didn't get any answers
that actually worked.

Thanks,
Ryan

Reply With Quote
  #3  
Old   
kemikTc
 
Posts: n/a

Default Re: (treeview) Collapsable hitarea - Yesterday , 08:20 PM



You have to unbind the click event on the span. Here's what I did:

$("#categories").treeview().find('span.[your span class]').unbind
('click').click(); //replace [your span class] with the class of your
nodes. By default they are 'folder'

the +/- will still collapse and expand, but the label (<span>) will
perform the action you specify.


In addition to that, you can add your own function that will be
executed when the user clicks on that node:

$("#categories").treeview().find('span.[your span class]').unbind
('click').click(function(){
//add the action you want to happen when the user clicks on the node
});

Reply With Quote
  #4  
Old   
kemikTc
 
Posts: n/a

Default Re: (treeview) Collapsable hitarea - Today , 10:17 AM



The removes the click event from folders

$("#treeview_id").treeview().find('span.folder').u nbind('click');


If you want to add your own click event, here's how:

$("#treeview_id").treeview().find('span.folder').u nbind('click').click
(function(){
//do something here
});

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.