ASTreeView 1.3.0 Release Notes

Just back from a trip to Santorini, Barcelona and Athens. :)

More photos at: http://www.jinweijie.com/europetrip2009

Back to the topic, the ASTreeView has been updated to 1.3.0, you may download at http://astreeview.googlecode.com/files/astreeview-1.3.0.zip 

New Features:

1. Html as TreeNodeText supported.
    In the new version, you may use html as tree node text, not only plain text.

image

2. Support escape edit/add input. 
    Set the EnableEscapeInput property to enable this feature, default is true.

image

3.Multiline Edit Mode supported.
   Set the EnableMultiLineEdit property to enable this feature, , default is false.

image

4. Drag and drop complete event now is available, sample:

    <script type="text/javascript">
        //parameter must be "elem"
        function dndHandler( elem ){
            document.getElementById( "<%=divConsole.ClientID %>" ).innerHTML 
+= (
">>node dragged:"
+ elem.getAttribute("treeNodeValue")
+
"<br />" ); } </script>

and then set the OnNodeDragAndDropCompleteScript="dndHandler( elem )"

image

5. New property for ASTreeViewNode – EnableChildren

Set this property to false can disable dragging other nodes to the current node as child nodes. please refer sample 1 to see the effect.

posted @ Sunday, November 22, 2009 10:48 AM

Print

Comments on this entry:

# re: ASTreeView 1.3.0 Release Notes

Left by Victor at 11/25/2009 4:41 AM
Gravatar
Hi, why the ASTreeview control events dont work on VB.net. the error:
"sys.webforms.PAgeRequestManagerServerErrorException : An unknown error ocurred while porcessing the request on the server. The status code returned from the server was: 500"
The examples in C# run fine.
I work with VS2005 and VB.net

Any idea?
Regards

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 11/25/2009 10:13 AM
Gravatar
@Victor,

you're using UpdatePanel?
could you set the EnablePartialRender=false for ScriptManager to get a more detailed error?

i really don't have any idea only with the 500 error,

thanks.

# re: ASTreeView 1.3.0 Release Notes

Left by yueting at 11/25/2009 1:12 PM
Gravatar
请问怎么保存astreeview里的数据到数据库里?我在页面里进行了拖放操作,怎么把拖放后的结构存在数据库里?

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 11/25/2009 1:46 PM
Gravatar
@yueting,

请参考实例项目中的Sample 9,谢谢

# re: ASTreeView 1.3.0 Release Notes

Left by Yi-Wen chen at 12/9/2009 1:40 PM
Gravatar
How to set some checked nodes in Edit Status?
1.I add a new data to databas in a page(use ASTreeView).
2. When I edit the added data in a edit page.
How to set the checked nodes of ASTreeView?
3.I had tried to find InitialDropdownText property in ASTreeView, but not succed.

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/9/2009 3:49 PM
Gravatar
Hello @Yi-Wen,

for the first question, i didn't understand it well, could you please make it clearer?

for the second question, you can traverse the tree nodes, and set the CheckedState of each node.

by the way, it ok if you write your question in chinese, thanks.

# re: ASTreeView 1.3.0 Release Notes

Left by Max at 12/9/2009 5:11 PM
Gravatar
请问在您网站实例项目sample 6 multi-selection中,当我click DropDownList时,其是会有vertical scrolls出现,但是下载元件其所附带demo source,本人测试ASTreeViewDemo6,click multi-selection之DropDownList,所带出的资料却无vertical scrolls,而是直接往下延伸?!请问要如何设定,让它自动带出vertical scroll,谢谢!

# re: ASTreeView 1.3.0 Release Notes

Left by Max at 12/9/2009 5:19 PM
Gravatar
我找到properties-MaxDropdownHeight设定了,谢谢!

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/9/2009 5:24 PM
Gravatar
@Max,
正要回复你,你就找到了,呵呵

# re: ASTreeView 1.3.0 Release Notes

Left by Pankaj at 12/10/2009 12:35 AM
Gravatar
This is a cool control. Thanks a lot!

# re: ASTreeView 1.3.0 Release Notes

Left by kranthi at 12/14/2009 7:13 PM
Gravatar
Hi,
Thanks for the great control.My requirement is that When I perform drag & drop ,the node into which another node is dropped should not turn into a folder.In onNodeDragandDropCompletedScript event I'm calling a javascript method,which in turn calls a C# method to update the database.Could you please tell me where should I set the DefaultfolderIcon to astreeview-node.gif?

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/15/2009 10:57 AM
Gravatar
hello kranthi,

for you question one, you can create your desired icon or just copy the leaf icon to a new file, and in the OnInit event of the page, set the treeview property like this:

this.astvMyTree.DefaultFolderOpenIcon = ResolveUrl( "~/Images/astreeview-node.gif" );



and for your second question, you can place a hidden button and a hidden field(can be a textbox or just a hidden field) in the page, like:

<div style="display:none;">
<asp:TextBox ID="txtHidden" runat="server"></asp:TextBox>
<asp:Button ID="btnSomeButton" runat="server"></asp:Button>
</div>
and in the dndHandler, you can trigger the button to fire a post back like:

document.getElementById("<%= txtHidden.ClientID%>").value = elem.parentNode.getAttribute("treeNodeValue")
document.getElementById("<%=btnSomeButton.ClientID%>").click();

then in your code behind, you can get the value of the dragged node.


thank you, please let me know if my explanation is not clear.

# re: ASTreeView 1.3.0 Release Notes

Left by Jim at 12/16/2009 12:53 AM
Gravatar
Hello Jin

I am interested in your control. Does it work with VS 2008? I have attempted to do so, but I get jscript errors. The first is

Microsoft JScript runtime error: '_rdc' is undefined

it continues from there. I believe it is an issue with using the .Net 3.5 framework rather than 2.0. I could be wrong though.

If you are / will support VS 2008, where is the download?

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/16/2009 9:36 AM
Gravatar
hello Jim,

Yes, the astreeview works with vs 2008.

I think the error you encountered is because you need to link the link the js files to your page. like:

<link href="<%=ResolveUrl("~/javascript/astreeview/astreeview.css")%>" type="text/css" rel="stylesheet" />
<link href="<%=ResolveUrl("~/javascript/contextmenu/contextmenu.css")%>" type="text/css" rel="stylesheet" />

<script src="<%=ResolveUrl("~/javascript/astreeview/astreeview_packed.js")%>" type="text/javascript"></script>
<script src="<%=ResolveUrl("~/javascript/contextmenu/contextmenu_packed.js")%>" type="text/javascript"></script>

thanks.

# re: ASTreeView 1.3.0 Release Notes

Left by john at 12/18/2009 12:21 PM
Gravatar
你好!在Sample 9中,我并没有看到怎么把拖动后的结构保存到数据库中,请问怎么保存呢?

# elem.parentNode

Left by Stephan at 12/22/2009 9:40 PM
Gravatar
hi here,
elem.parentNode.getAttribute("treeNodeValue") always returns empty :-(
doing an alert(elem.parentNode) returns 'object', as exptected.
Any thoughts?

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/23/2009 9:41 AM
Gravatar
Hello Stephan,

Could you tell me in which sample the problem occurs? so i can debug. thanks.

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/23/2009 9:42 AM
Gravatar
Hello john,

遍历节点的时候就可以挨个保存了,谢谢

# re: elem.parentNode

Left by Stephan at 12/23/2009 6:50 PM
Gravatar
Hi jinweijie, thank you for your quick response!

The problem occurs on my project, not on your samples ;-)

This is the tree:
<ct:ASTreeView
ID="trvProcessNew"
runat="server"
AutoPostBack="false" BasePath="~/Javascript/astreeview/"
ExpandDepth="0"
DataTableRootNodeValue="0" EnableRoot="false"
EnableNodeSelection="false"
EnableCheckbox="false"
EnableDragDrop="true" OnNodeDragAndDropCompleteScript="dndHandler(elem)"
EnableTreeLines="true"
EnableNodeIcon="false"
EnableCustomizedNodeIcon="false"
EnableDebugMode="false"
EnableMultiLineEdit="false"
EnableContextMenu="true" EnableContextMenuEdit="false"
EnableContextMenuDelete="false"
EnableAjaxOnEditDelete="false"
EnableContextMenuAdd="true"
ContextMenuAddText="neuer Prozess zufügen"
AddNodePromptMessage="Name des neue Prozesses" AdditionalAddRequestParameters="{'t':'ajaxAdd'}"
AddNodeProvider="adProcess.aspx" />

---------------------------------
I built the tree like this:

private void BindTreeView()
{
DataRow[] drArray = DS_tblProcess.Tables["Process"].Select("parentID = null OR parentID = 0");
foreach (DataRow dr in drArray)
{
string sName = dr["shortName"] + " (" + dr["name"].ToString() + ")";
string sPK_Process = dr["PK_process"].ToString();
ASTreeViewLinkNode oNode =
new ASTreeViewLinkNode(sName, sPK_Process, "javascript:postBackHiddenField('HiddenField1', " + sPK_Process + ")", "", "tooltip");
trvProcessNew.RootNode.ChildNodes.Add(oNode);
BindSubGroups(sPK_Process, oNode);
}
}

private void BindSubGroups(string parentValue, ASTreeViewLinkNode ParentNode)
{
DataRow[] drArray = DS_tblProcess.Tables[0].Select("parentID = " + parentValue);
foreach (DataRow dr in drArray)
{
string sName = dr["shortName"] + " (" + dr["name"].ToString() + ")";
string sPK_Process = dr["PK_process"].ToString();

ASTreeViewLinkNode oNode =
new ASTreeViewLinkNode(sName, sPK_Process, "javascript:postBackHiddenField('HiddenField1', " + sPK_Process + ")", "", "tooltip");
ParentNode.AppendChild(oNode);
BindSubGroups(sPK_Process, oNode);
}

------------------------------------

JavaScript, where I don't get the elem.parentNode.getAttribute("treeNodeValue"),
I had to disect the ID, who contains (lucky me!) the ID:

function dndHandler(elem)
{
var mySplitResult = elem.parentNode.id.split("_");
document.getElementById("txbSourceID").value = elem.getAttribute("treeNodeValue");
document.getElementById("txbNewParentID").value = mySplitResult[2];

if(!isNaN(mySplitResult[2]))
{
document.getElementById("lblTask").innerHTML = "success in retrieving ParentID";
}
else
{
document.getElementById("lblTask").innerHTML = "Error retrieving theID";
document.getElementById("btnSave").disabled = true;
}
}

Do you have an idea why elem.parentNode.getAttribute("treeNodeValue")
alway returns an empy string?

Your tree is just woderfull, I'll talk my boss into submitting a fee for this great component..

cheers, Stephan

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/24/2009 9:23 AM
Gravatar
Hello Stephan,

i think you may need to replace "elem.getAttribute("treeNodeValue")", with "elem.parentNode.getAttribute("treeNodeValue")"?

and thank you very much for your support!

# re: elem.parentNode

Left by Stephan at 12/24/2009 3:47 PM
Gravatar
Hi Jin,

elem.parentNode.getAttribute("treeNodeValue")
always returns null..

elem.parentNode.id returns null when (and only when) the node has no children..

In other words: I can move a node only to nodes already containing childern.

greetings from Switzerland, Stephan
:-)

# re: elem.parentNode Notes

Left by Stephan at 12/24/2009 4:02 PM
Gravatar
Hi Jin,
maybe it helps, here is the html of a node:

..contextmenutrvProcessNew_ascmContextMenu.getSelectedItem());....

<ul id="trvProcessNew_ulASTreeView" class="astreeview-tree">
<li id="trvProcessNew_li_node_18583" treeNodeType="1" treeNodeValue="28" class="line-top" openState="1" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" checkedState="2">
<img src="/Domasy_50/Javascript/astreeview/images/astreeview-plus.gif" icon-type="0" class="astreeview-plus-minus" />
<a id="trvProcessNew_hlASTreeNode2" title="tooltip" class=" ContextMenutrvProcessNew" disableedit="true" disabledelete="true" is-astreeview-node="true" href="javascript:postBackHiddenField('HiddenField1', 28)">
MP 1 (MetaProc 1l)


<ul style="display:none;" class="line-vertical">
<li id="trvProcessNew_li_node_28583" treeNodeType="1" treeNodeValue="29" class="line-middle" openState="1" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" checkedState="2">
<img src="/Domasy_50/Javascript/astreeview/images/astreeview-plus.gif" icon-type="0" class="astreeview-plus-minus" />
<a id="trvProcessNew_hlASTreeNode3" title="tooltip" class=" ContextMenutrvProcessNew" disableedit="true" disabledelete="true" is-astreeview-node="true" href="javascript:postBackHiddenField('HiddenField1', 29)">
P 1-1 (Proc 1-1)


<ul style="display:none;" class="line-vertical">
<li id="trvProcessNew_li_node_33453" treeNodeType="1" treeNodeValue="32" class="line-bottom" openState="1" enable-edit-context-menu="true" enable-delete-context-menu="true" enable-add-context-menu="true" checkedState="2">
<img src="/Domasy_50/Javascript/astreeview/images/astreeview-plus.gif" icon-type="0" class="astreeview-plus-minus" style="visibility:hidden;" />
<a id="trvProcessNew_hlASTreeNode4" title="tooltip" class=" ContextMenutrvProcessNew" disableedit="true" disabledelete="true" is-astreeview-node="true" href="javascript:postBackHiddenField('HiddenField1', 32)">
ko (process)

</li>
</ul>
</li>

<li id="trvProcessNew_li_node_43453" treeNodeType="1" treeNodeValue="31" class="line-...........

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 12/25/2009 9:49 AM
Gravatar
Hello Stephan,

I'll talk with you by email. :)

# re: ASTreeView 1.3.0 Release Notes

Left by Minseok at 1/5/2010 4:32 PM
Gravatar
Hello Jin.

I appreciate about your good control. I try to make use of it in my project. But I need your help.
When getXML button is clicked in Demo1, there are some incorrect output among xml data displayed in the console part.
I guess it is involved with the method 'GetTreeViewXML'.
.......
node-icon="~/Images/demoIcons/msdn.gif" enable-drag-drop="~/Images/demoIcons/msdn.gif" enable-siblings="~/Images/demoIcons/msdn.gif" enable-children="~/Images/demoIcons/msdn.gif"
...

Maybe, values of enable-drag-drop, enable-siblings and enable-children are replaced by the value of node-icon column incorrectly.

Please, could you correct that?
I thank for you previously...

# re: ASTreeView 1.3.0 Release Notes

Left by Minseok at 1/6/2010 8:59 AM
Gravatar
Hi Jin..

Your laborious job gave me a lot of hope in my project.
I thank you again.
During my looking into the code, I found that there is some difference in xml output generated by both demo 1 and demo 4, which are using ASTreeViewLinkNode method and Xml data source respectively.
Instead of the former having attributes such as navigate-url="http://www.msdn.com/" target="frm" tooltip="Goto MSDN", the latter does not.
Please, could you let the latter have the same thing with the former?

Can I make a suggestion for styling nodes instead of inputing html tags with a value of a node.
My suggestion is to add a attribute about CSS definded by a user like this:
css-name="NewItem"

Again, I always thank you.
I almost forgot. I hope not too late. Happy New Year!

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 1/6/2010 9:42 AM
Gravatar
@Minseok,

Happy New Year! :)

The reason why there's difference in xml between sample 1 and 4 is that the node type is different.

in sample 1, i use the ASTreeViewLinkNode while in sample 4 i use ASTreeViewNode. To determine the node type, i use an attribute called "node-type" in xml, you can see in sample 1, node-type="1" while in sample 4, node-type="1"

So if you want the tooltip, target... you may just set the node-type="1" as in sample 1.

And yes, you can style all the nodes like( just add to the head of the page):


<style type="text/css">
.astreeview-tree li a, .drag-container li a{
color:red; /*for example*/
}
</style>

Thanks

# re: ASTreeView 1.3.0 Release Notes

Left by Minseok at 1/6/2010 10:41 AM
Gravatar
Hi jin!
I thank for your kind explanation for my question.
First, I clearly figure out node-type.
But as far styling a node, I want each node set different style by adding an attribute about css. Finally each node has each css property as an attribute.
I wish my explanation would be clear.

Thanks alot.

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 1/6/2010 10:58 AM
Gravatar
Hell Minseok,

I am afraid you cann't set a css class, but you can set the "style" of each node, like:

this.astvMyTree.RootNode.ChildNodes[0].AdditionalAttributes.Add( new KeyValuePair<string,string>("style", "color:blue;") );

# re: ASTreeView 1.3.0 Release Notes

Left by PEN at 1/7/2010 2:05 PM
Gravatar
Is there any similar control for Windows Forms instead of Web.

Thanks

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 1/7/2010 5:55 PM
Gravatar
Hello @PEN,

Sorry I don't know. :)

# re: ASTreeView 1.3.0 Release Notes

Left by Oscar at 1/12/2010 10:20 PM
Gravatar
I've set the following options
<ct:ASTreeView ID="astFile"
...
DefaultNodeIcon="~/UI/images/folder-closed.png"
DefaultFolderIcon="~/UI/images/folder-closed.png"
DefaultFolderOpenIcon="~/UI/images/folder-open.png"
...
/>
Is it correct that the icons don't change dynamically when you expand or collapse a node? In my case they don't :) It keeps showing the closed icon.

And how can I set the link of the root node?

Btw, you've developed a great control!

# re: ASTreeView 1.3.0 Release Notes

Left by jinweijie at 1/13/2010 9:54 AM
Gravatar
Hello @Oscar,

Please use ResolveUrl. Thanks.

Your comment:



 (will not be displayed)


 
 
 
Please add 1 and 8 and type the answer here:
 

Live Comment Preview:

 
View posts by date
«March»
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910