Is there any build in javascript function to expand/collapse any treeview particular node from client?
Actually I am using treeview with checkboxes enabled and I want to have a particular node collapsed and unchecked initially, and when checked should be expanded.
Any built in thing or idea?
I couldn't find any way yet...
Edit:
I tried checking if collapsed nodes are invisibly(display:none or something) available on the page so that I can play with some javascript to make them visible on checkbox changed of parent node, but found they are not at all rendered on the page :(
Found the answer!
I was wrong, it does render collapsed nodes with [display:none] and so my problem is solved.
I am now binding client onclick event on treeview and there I am making collapsed nodes visible when there parent node is checked, as per my requirement.
Thanks!
Related
I need fire event from parent component to childs components like broadcast method in AngularJS. How it possible in RactiveJS?
P.S: For example i have a tabs with different content includes components, when tabs renders only one tab active(visible) other tabs are hidden. When i select other tab it become active and show content. At this moment tab should send event refresh down to the childs component to let they know that they must initialize or refresh (because while it was hidden it couldn't initialized right).
Within the tab component, observe that the tab has become "active" and call refresh:
this.observe('active', function(active){
if(active){ control.refresh() }
})
Events don't fire down the hierarchy.
One option would be to put the template in a section watching a visible or rendered flag. Then set the flag to true when the tab becomes active. If there is something outside of the template that needs to be handled, you can observe it from your script.
Out of curiosity, what can't initialize correctly while it's hidden? Or do you mean not rendered, as there is no DOM to access? In that case, you may want to look into decorators.
I have a Flex TileList with an itemRenderer made by me.
The list loads the content perfectly and renders it.
Renderer is a simple canvas element with a checkbox and another canvas with some labels with data.
I implemented a method that, on TileList itemClick="clickedItemHandler(event)", changes the state of the checkbox (if checked -> uncheck, and vice versa).
Problem is: the method works if i click on any place of the item, EXCEPT the checkbox. When i click the checkbox, it doesn't change state.
My thoughts: maybe i was changing the state of the checkbox, and the event changing it back, but i debugged it and it doesn't look like so..
The solution is actually quite simple. Perhaps the best way to make this work is making sure the CheckBox ignores mouse clicks, and this can be done by setting the "mouseEnabled" attribute to false.
Cheers
I think you're probably correct. The checkbox toggles when you click it and then you toggle it back when the event gets to the TileList. You may not see this when debugging depending on how you are confirming... you may be able to fix this by confirming that the target of the event is not a CheckBox.
I am trying to Drag a toolbar button to a tree node. Is it possible? I have noticed that drag start is never fired. Is there any list of components/classes available that currently allow to be dragged?
Toolbar buttons can not be dragged. Currently this feature is disabled in Qooxdoo. Instead You can use Menu Button. I know this is not proper way and not Elegant but at-least you can have the functionality you want.
And Sorry for the second Question about List of Drag-ables, There is no such list available yet
I am trying to Drag a toolbar button to a tree node. Is it possible?
Buttons can not be dragged, is is not a normal UI behavior. If you really want do drag a button, you have to implement your own behavior. Extend from the button and override the methods for mouse up and mouse down behavior.
Is there any list of components/classes available that currently allow to be dragged?
Sorry, no, there is no list.
I'm using Views dropdown filter (with tags) and it works great. However I would like to customize it in this way:
1 - remove button "Apply" and automatically update Views (at the moment I'm updating it with Ajax)
2- allow my customer to change the order of the dropdown items (specifying top items)
3- select multiple items without having to press the SHIFT button on keyboard (do not unselect other items if new items are selected)
http://dl.dropbox.com/u/72686/viewsFilter1.png
Let's suppose the items in the image are tags... something like this:
http://dl.dropbox.com/u/72686/viewsFilter2.png
thanks
Use jQuery to .hide() the Apply button, and then set a handler on the filter fields so that whenever one of them is changed (i.e., by the user), the Apply button registers a click.
Hmm, can't help with this one. You might be stuck writing a custom module that hooks into the Views API.
Sounds like the Sexy Exposed module would solve this problem?
I'm using the following code to keep the items selected and it works.
$('#edit-tid option').click(function() {
$(this).toggleClass("selected");
$("option:not(.selected)").removeAttr("selected");
$("option.selected").attr("selected", "selected");
//submit request
$('#edit-submit-Portfolio').click();
});
When a request is submitted the page is refreshed. The selected items are still selected (class="selected") but the javascript code do not keep them selected.. I don't understand why, since they have the correct class attribute.
So.. it doesn't work after refresh, even if the html code is the same (the same class="selected" attribute is assigned to the same items).
thanks
I've solved point 1 and 2, installing better exposed filter module from drupal website.
I have an ajax controltoolkit reorderlist within an asp.net application.
I need to disable certain specific steps from being reordered. This has to be done dynamically. All steps are consecutive and start from the beginning, but it's not known until runtime how many need to be disabled from being reordered any further.
I tried the e.item.enabled = false for reorderlist_itemdatabound but this just disabled links. I need to disable the drag handler.
Any help is greatly appreciated. Thanks!
To be honest, I'm not too familiar with this control, but...
You need to hide the drag handler div (or whatever is in the 'DragHandleTemplate' I believe) and/or change its class. Two suggestions:
1) Add a javascript startup script to disable the divs in question.
2) Subclass this control... Override the Render() method. Replace it with original code from ReorderList, but check the Item to see if you should render the drag handle.
as a workaround to disable drag'n'drop for some item - you can set width=0 to the control inside <DragHandleTemplate> </DragHandleTemplate>. Thus user won't be able to pick the item for dragging.
Suppose you have an image with id dragme in DragHandleTemplate; you can do this in the ItemDataBound handler:
Image dragMe = (Image)((TableRow)e.Item.Controls[0].Controls[0]).Cells[0].Controls[0].FindControl("dragMe");
dragMe.Style.Add(HtmlTextWriterStyle.Visibility, "hidden");
This way you preserve the alignment.