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

General Client side question (considering a more from DevExpress)

1 Answer 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
Scott Waye asked on 19 Nov 2009, 07:35 AM
Hi,  I am currently working with DevExpress controls and I'm considering a move.   Can you tell me how your controls handle the problem of identifying, client side, a telerik control inside a user control which appears on the page more than once.  Let says you have a page with a user control of type InnerControl, and inside that control you have a Telerix ListBox which you want to identify in some javascript function to perform some behaviour that is relevant to the InnerControl.  I.E. you want to place the javascript with the user control (either in the same file, or a file included by the ascx of the InnerControl).  Now further imagine that there is another user control on the same page of a different type, say OuterControl and this control also contains an instance of the InnerControl.  What is the recommended way of generating the client side javascript for the InnerControl, given that there will be 2 instances of the InnerControl on the final page and that you cannot have 2 javascript objects with the same id, or 2 javascript functions with the same name?

As an extension to this problem, what happens to the javascript client side object of the List Box when the InnerControl is reloaded using a callback (not a postback)?  Is a new object created, or is the old one reused?

Hope that makes sense and thanks for your time.

--
Scott

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 24 Nov 2009, 02:37 PM
Hello Scott Waye,

I suppose that this KB article will help you:
Using dynamic/unique names for JavaScript functions


Greetings,
Veselin Vasilev
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.
Tags
General Discussions
Asked by
Scott Waye
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Veselin Vasilev
Telerik team
Share this question
or