This is a migrated thread and some comments may be shown as answers.

Class added to Node does not persist after postback

1 Answer 44 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 14 Aug 2014, 03:15 PM
I have two RadTreeViews and am using these to create a data picker... so Available nodes on the left treeView... User Selected nodes on the right treeView...

After the user has selected a node and moved it to the right treeView, I would like to style the nodes as follows:

SelectedNode : Bold [Node Enabled]
ParentNode: Grey [Node Disabled & Node Expanded]
ChildNodes: Normal font [Node Disabled]

I use javascript to achieve this, which works fine the first time round using the 'window.onload' event.

Issue: When I postback the page... all settings remain in place (eg - enabled/disabled) but the styles do not.

I use the trackChanges() and commitChanges() around my javascript code.

I am using the following to remove classes
$telerik.$(node.get_element()).removeClass('bold');

I am using the following to add classes:
$telerik.$(node.get_element()).addClass('bold'); - Does not persist

I am using the following to enable / disable nodes
node.set_enabled(true); - Persists fine...

Can anyone advise why the settings persist but the css styles do not?

Thanks

1 Answer, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 1
answered on 14 Aug 2014, 04:12 PM
I've found it... node.set_cssClass('myclass')

should have taken a guess!
Tags
TreeView
Asked by
Craig
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 1
Share this question
or