Hello,
Is anyone aware of a (pre-existing) way to get rad controls' script objects from a collection of DOM objects (all of this on the client-side)?
I'll explain (this is a simplistic example, and other solutions apply for this example, but it will illustrate the scenario):
Imagine I want to get a collection of objects on the page, like all rad textboxes that had "Company" in their ID, and I want to clear them.
Outside of rad, I'd use jQuery, something like:
But say I'd like to use the .clear() function on the script object (the javascript object that is returned by $find(), instead of $get()) -- is there a way to get an array of the script objects if I have a jQuery collection of the DOM objects?
I know that this isn't a strong usage scenario (the .clear() on the script object may be the same as the setting the HTML object's value to empty string), but other scenarios could exist, like setting up events in bulk, changing the selected item on a RadComboBox in bulk, dynamically modifying an object such that you need to use .trackChange() and .commit(), etc.
I also know converting a bunch of DOM objects to a bunch of script objects isn't difficult -- it would essentially be looping over each DOM object in a collection, either examining a property on the DOM object as a filter (to see if represents a Telerik control) before calling $find on the DOM object's ID, or calling $find on all DOM object IDs and checking a property on the script object (if it isn't null; to see if it represented a Telerik control).
I'm asking if some functionality (like a jQuery plugin) had been developed, or is maintained by Telerik, so that you guys can optimize it (maybe there is a way to get the script objects without a loop), or any member of the community, so the effort isn't duplicated.
Anyone aware of a pre-existing methodology or library call to achieve this functionality?
Thanks,
Matthew
Is anyone aware of a (pre-existing) way to get rad controls' script objects from a collection of DOM objects (all of this on the client-side)?
I'll explain (this is a simplistic example, and other solutions apply for this example, but it will illustrate the scenario):
Imagine I want to get a collection of objects on the page, like all rad textboxes that had "Company" in their ID, and I want to clear them.
Outside of rad, I'd use jQuery, something like:
$(":text[id*=Company]").val(""); |
But say I'd like to use the .clear() function on the script object (the javascript object that is returned by $find(), instead of $get()) -- is there a way to get an array of the script objects if I have a jQuery collection of the DOM objects?
I know that this isn't a strong usage scenario (the .clear() on the script object may be the same as the setting the HTML object's value to empty string), but other scenarios could exist, like setting up events in bulk, changing the selected item on a RadComboBox in bulk, dynamically modifying an object such that you need to use .trackChange() and .commit(), etc.
I also know converting a bunch of DOM objects to a bunch of script objects isn't difficult -- it would essentially be looping over each DOM object in a collection, either examining a property on the DOM object as a filter (to see if represents a Telerik control) before calling $find on the DOM object's ID, or calling $find on all DOM object IDs and checking a property on the script object (if it isn't null; to see if it represented a Telerik control).
I'm asking if some functionality (like a jQuery plugin) had been developed, or is maintained by Telerik, so that you guys can optimize it (maybe there is a way to get the script objects without a loop), or any member of the community, so the effort isn't duplicated.
Anyone aware of a pre-existing methodology or library call to achieve this functionality?
Thanks,
Matthew