 |
|
 |
I have a treepane defined like so:
<cc1:TreePane
AutoPostBack="true" ID="TreeClasse" CheckBoxTree="True"
BackColor="#F9F9F9" enableDD="false"
runat="server" OnNodeChecked="TreeClasse_NodeChecked"
Width="200px" Height="300px" animate="True">
</cc1:TreePane>
I want you capture the event when a node is checked and no checked.
protected void TreeClasse_NodeChecked(object sender, ExtExtenders.NodeCheckedEventArgs e)
{
ExtExtenders.TreePane tree = new ExtExtenders.TreePane();
tree = this.TreeClasse;
if (tree.TreeNodes.Count > 0)
{
foreach (ExtExtenders.TreeNode node in albero.TreeNodes)
{
if (e.NodeChecked.IsChecked)
{
e.NodeChecked.IsChecked = true;
this.TextBox.Text = e.NodeChecked.id.ToString();
}
}
}
}
But the called function "TreeClasse_NodeChecked" it doesn't answer to the event.
Do you know me to help?
|
|
|
|
 |
|
 |
Hello,
First of all thanks for the great controls. For now I am using only TreePane. An have some questions.
I am new to all this Aspx.NET, Javascript. I try to integrate you controls to Sharepoint and got some problems:
1. I don't know how to expand tree nodes programically. Is there some sort of function or property which I mist?
2. In Sharepoint site I need to do some data filtration which depends on selected node. So I add some nodes in treepane, using Loader and function which I have taken from test site example, then I expand them, select one node (the node has got href, which has to open page, and by params, which I post to link, filter some sort data, the filter page is another story and it does not matter now) and it links me to another page, but the problem is that this link reloads whole page, so the treepane reloads again and after reload nodes are collapsed. But I don't want them to collapse, I understand that after reload all data is gone, and needes to fill up again, step by step.
So can you give me any hint on my problems ?
Sorry for my English.
Will be waiting for any answer.
Thank You again for great work.
|
|
|
|
 |
|
 |
I really liked how you wrapped the Extjs into C# controls , but as long as ExtJS is still growing up and I suffered from ugrading from 1.1 to 2.0 I would better stick to javascript!
|
|
|
|
 |
|
 |
You just named on reason to use the controls...
When ExtJs was updated , you could still use the controls without even knowing that the javascript was updated...
All changes where made behind the scenes in the controls javascript.
|
|
|
|
 |
|
 |
how to add more parameters to the context request. for example I want to get list by function division and manager
|
|
|
|
 |
|
 |
You can use a property of the node called nodeType to pass additional parameters.
|
|
|
|
 |
|
 |
It's ok, when I put the control directly into the main form. But when I put TreeView control into the user control, than its ClienID looks like "ctl03_TreePane" and it causes a javascript error. So, what you think about it?
|
|
|
|
 |
|
 |
Are you using the code avaiable here?
Cause this is a very old code...I would update it if I could , but since the article was edited by the codeproject team I cant.Check-out the code avaiable at codeplex.
|
|
|
|
 |
|
 |
Hi there, I want to say Great job on these controls. I am so impressed with what you have done. But I seem to be unable to change the tree Images, Instaead of the folder Icons I have images that I want to put. Please, How can I do this ? Thanks
|
|
|
|
 |
|
 |
Yes.. just use the icon property of the node...
Ex:
GridControl.TreeNode no = new GridControl.TreeNode();
no.draggable = true;
no.id = ds.Tables[0].Rows[i]["id"].ToString();
no.text = ds.Tables[0].Rows[i]["text"].ToString();
no.leaf = !HasChildren(ds.Tables[0].Rows[i]["id"].ToString());//see if the node has children
no.parentNodeId = context.Request["node"];
no.icon = "images/square.gif";//relative path
nodes.Add(no);
|
|
|
|
 |
|
 |
Thanks for your quick reponse
And How can I create tool buttons in the menu instead of menus ? I tried one menu it always shows the dropdown icon next to it ? I just want the toolbar Without the menus
|
|
|
|
 |
|
 |
Looks like you are a mind reader.. I missed that option too so I am developing it to the next release..its almost ready, I just want to make a few more tests.
|
|
|
|
 |
|
 |
No qualms . I would wait great Job!!!
And about changing the Theme ?
|
|
|
|
 |
|
 |
The grouping grid example shows how to do that. The dll comes with only one theme
you have to copy all images and css of a theme to your site to use it.
I did that because the dll is already too big with only one theme...
|
|
|
|
 |
|
 |
I just grabbed the latest code from the codeplex site. Thanks for the speed response. I hope the forms implementation will be the next cool thing as well as the accordion control.
Thanks! I wish I could help in some way.
-- modified at 11:31 Tuesday 6th November, 2007
|
|
|
|
 |
|
 |
How can I make a node stay selected after postback supposing the selected node is 3 levels deep ?
|
|
|
|
 |
|
 |
Use the tree together with an updatePanel (like the examples)
then the tree is never really reloaded...its the only way I can think of.
|
|
|
|
 |
|
 |
I found a solution by adding a hidden field and implementing the "click" event in JS on the page. This also is good when the selected treenode id is in the querystring and you want to auto select a node.
I also made 2 small patches to your control:
1. Added ResolveClientUrl to the getter of the Loader property to resolve "~/..." urls.
2. Added the missing Index parameter to the TreeNodeMoved Server Event
My be it will be better to add the auto select a treenode functionallity to the your core control ?
I can send you my modifications.
|
|
|
|
 |
|
 |
Hi,
How can i get a reference in javascript for the root element in order to get an element by it's ID or use any of the ExtJS function on the client ?
|
|
|
|
 |
|
 |
Lets suppose the control has the id TreePane and the code below is
inside script tags.
var extender=$find("TreePane_TreePaneExtender");
var tree = extender.get_Tree();
//now you can use the Ext api
tree.getNodeById("");//
|
|
|
|
 |
|
 |
Thanks, but it doen't work.
My page has an async-loader that works fine.
The page's source has:
$create(GridControl.TreePaneBehavior, {"CheckBoxTree":false,"ContextMenu":"null","Editable":false,"Loader":"/dnndev/DesktopModules/DynEntities/FieldsTreeHandler.ashx","TreeNodes":"[{\"text\":\"root\",\"draggable\":false,\"id\":\"eid5\",\"leaf\":false,\"cls\":null,\"IsRoot\":false,\"parentNodeId\":null,\"href\":\"#\",\"hrefTarget\":null,\"icon\":null,\"IsChecked\":false}]","animate":false,"autoPostBack":false,"containerScroll":true,"ddAppendOnly":false,"ddGroup":"TreeDD","enableDD":false,"enableDrag":false,"enableDrop":false,"id":"dnn_ctr371_ViewDesigner_Tabs_TabFields_treeFields_TreePaneExtender","lines":false,"rootVisible":false}, null, null, $get("dnn_ctr371_ViewDesigner_Tabs_TabFields_treeFields"));
but, thw following return NULL:
alert($get("dnn_ctr371_ViewDesigner_Tabs_TabFields_treeFields_TreePaneExtender"));
|
|
|
|
 |
|
 |
to get a reference to the extender sometimes I use a setTimeout to wait for the extender to be loaded...
function help(){
var extender=$find("xxxx_TreePaneExtender");
if(extender==null){
setTimeout("help()",100);
return;
}
//other code here... the extender does not load immediately.
}
|
|
|
|
 |
|
 |
I use a debugging button to show the alert after I see the loaded tree and still it shows NULL.
Does it work for you ? did you actually try it ?
|
|
|
|
 |
|
 |
Yes.. here is a live example
http://www.extendersamples.qsh.eu/checkboxtree.aspx
you have to use a setTimeout and you have to use the $find function not the $get function.
-- modified at 7:00 Monday 22nd October, 2007
|
|
|
|
 |
|
 |
OK, I found the solution:
I should use for example:
var tree = $find("dnn_ctr371_ViewDesigner_Tabs_TabFields_treeFields_TreePaneExtender").get_Tree();
meaning:
I have to use $find with the full ClientID + "_TreePaneExtender" to get the reference to the tree object
-- modified at 4:58 Tuesday 23rd October, 2007
|
|
|
|
 |