jQuery UI Widgets › Forums › Navigation › Tree › Manipulate tree node's label
This topic contains 6 replies, has 3 voices, and was last updated by Mhanna AbuTareef 11 years, 10 months ago.
-
Author
-
Hi,
Is it possible to change the label of the tree items to look like this:
Category1
Item1 0
ItemItem1 0
Item1 0
Category2
Item 0
ItemItem 0
ItemItem 0That’s means each item of the table has two parts, where part 1 aligned to the left and part 2 aligned to right.
Regards,
Mhanna
Hello Mhanna,
You can style the labels however you like as shown in the demo Default Functionality.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi,
In case i wanna use binding by data adapter, how could i style the labels?
In this binding i may use the text field ( and later map to label field). but text field is a string.
Regards,
Mhanna
Hi,
Is there a solution?
Regards,
Mhanna
Hi guys,
After the Tree’s initialization, the Tree will be built from UL/LI tags again. This means that you can use the approach that Dimitar suggested you or you can use jQuery to select the appropriate HTML Tag and change its appearance. Another approach is to use the recently added updateItem method of jqxTree.
Invoke the updateItem method.// @param element (li tag) $('#jqxTree').jqxTree('updateItem', element, {label: "New Label"}); The following code updates the first item.var treeItems = $("#jqxTree").jqxTree('getItems');var firstItem = treeItems[0];$('#jqxTree').jqxTree('updateItem', firstItem, { label: 'Item' });
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi,
I already noticed that the element is created by UL\LI tag. So, i tried to add style in the text field as follows:
data: [
“id”: “anyID”
“parentid”: “any”
“text”: ‘ some text ‘
]It works, and i see the item in a paragraph.
However, When i insert a style, as follows, the result is strange. you can try. why?
data: [
“id”: “anyID”
“parentid”: “any”
“text”: ‘ some text ‘
]Hi,
I mean these examples:
example 1:
data: [{"id": "anyID""parentid": "any""text": ' <p><strong>some text </strong></p>'}]
example 2:
data: [{"id": "anyID""parentid": "any""text": ' <span style:"color:red">some text </span>'}]
-
AuthorPosts
You must be logged in to reply to this topic.