I have successfully implemented the ValueChanged clientevent to capture the value of hte slider and put it in a text box... this works great when i know the ID of the text box at design time. However, I'm encapsulating the slider in a compositeControl and need to figure out a way to get the clientID of the textbox at runtime for the slider (there are many of these composite controls on the page so I can't use a static value)
normally i would render out the call to the javascript and put in the client id, but because you have "wrappered" the valuechanged event and force me to only have 2 arguments (this, events) I can't do that.
Is there any way to override the javascript function call and add my own parameters and still have access to the values in the control?
i hope this makes sense.
thanks
Thats fine. Thanks a lot for your support.
Thanks,
Bhaskar
Hi Bhaskar,
Some Infragistics controls internally use ig_controls[idOfControl], but if at the time there are no Infragistics controls on page, then it will give you exception. So that object, it is not recommended for public use.
I do not know other public option to get reference to a javascript object.
Thanks Viktor, I have used $find it works great.
However, Is there any equivalent direct JavaScript function to get a reference to javascript object.
once again thanks for your valuable support.
Thanks
The document.getElementById(id) or $get(id) returns reference to html element or null. If you want to do any action with slider, then you need reference not to html element, but reference to javascript object. You should use $find(id) or similar method.
Hi,
Thank you very much for your quick reply
I have slightly modified your code. Here is the modifid code
function updateMySlider() { var tb = document.getElementById('TextBox1'); ---modified by me var slider = document.getElementById('WebSlider1'); --modified by me var val = parseInt(tb.value); if ('' + val != 'NaN') slider.set_value(val); }
I have got an JS error at line called " slider.set_value(val);" The error is as foolows:"Microsoft JScript runtime error: Object doesn't support this property or method"
Other details: Used Infragistics NotAdvantage for .NET 2009.1 ver
Please suggest any thing is wrong in the above code.