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

panelBar.set_cssClass() doesn't work

5 Answers 77 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
mac-mac
Top achievements
Rank 1
mac-mac asked on 15 Oct 2009, 07:58 AM

Hi

panelBar.set_cssClass() method doesn't seem to work on my project.

childItem =

new Telerik.Web.UI.RadPanelItem();

 

childItem.set_text(msgNoRecords);

childItem.set_cssClass(

"noDisplayClass");

 

 

 

...add item follows...


Am using this version:  2008.1.515.35

Any idea?

Thanks

mackey

 

5 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 15 Oct 2009, 08:15 AM
Hi mac-mac,

This version of RadControls is not supported anymore. Please update to the latest version of RadControls for ASP.NET AJAX and let us know how it goes.

All the best,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
don
Top achievements
Rank 1
answered on 15 Oct 2010, 05:18 PM
Hello Support ... I have a very similar problem with the RadTreeNode in this version.  the set_cssClass method does not actually set the class when called via client-side javascript.  The property works fine when the attribute is sent down from the server.  The application is near end of life and "upgrading to the latest version" is not feasible for it.  Can you tell me if this problem has been fixed in the latest release and if so, what the fix is so I might be able to hack it into this release?

client script to repro:
children is the parent node's get_nodes() result:
data is a name/value collection of node data.

var

 

node = new Telerik.Web.UI.RadTreeNode();

 

node.set_text(data.T);

node.set_value(data.V);

 

node.set_cssClass(data.C);

 

children.add(node);

0
Cori
Top achievements
Rank 2
answered on 18 Oct 2010, 01:35 PM
Hello don,

Why not try using this approach to set the class for the node:

$telerik.$(node.get_element()).addClass("data.C");

See if that works work for you. Also, before trying that, I noticed you didn't enclose data.C in quotation marks. Perhaps that is the reason why it doesn't work.

I hope that helps.
0
don
Top achievements
Rank 1
answered on 19 Oct 2010, 06:01 PM
"data.C" is a literal whereas data.C looks up the key "C" from name/value collection object "data" and resolves that value, then assigns it as the css class.  net superstar?

For anyone who wants a real partial solution instead of useless reply, I found that if I refetch the parent and its children, then reset the property to its existing value, it renders correctly.  This smacks of a code bug and I still wonder if the support team is willing to publish the known problem in this old release and the corrected code in the current release.

... all my code above ...

pseudo-code fix
var children=parent.get_nodes();
foreach(child in children)
  if (child.get_cssClass()) child.set_cssClass(child.get_cssClass())

This seems to work although the actual class is attached to a different HTML element than if the cssClass is set by the server and sent down in the first place.  We can fix that through the styling itself.

Inconsistency == bug
in my book. 
We pay for support.  Or at least I thought we got support when we paid.  We definitely paid.  The check has already cleared.  Support seems to have vanished.
0
Cori
Top achievements
Rank 2
answered on 20 Oct 2010, 04:15 PM
So are you saying it doesn't work if you change what I posted to this?

$telerik.$(node.get_element()).addClass(data.C);
Tags
PanelBar
Asked by
mac-mac
Top achievements
Rank 1
Answers by
Paul
Telerik team
don
Top achievements
Rank 1
Cori
Top achievements
Rank 2
Share this question
or