Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Using a WebSlider within UltraWebGrid Templates
posted

 We have been using the webgrid template feature extensively but are having difficulty in accessing the WebSlider control within the template using client side events. We've managed successfully to employ a WebDateChooser utility which allows us to access those features in BLOCKED SCRIPT

var combo1 = igdrp_getComboById('ctl00_ContentPlaceHolder1_UltraWebTab2__ctl3_UltraWebGrid4_ctl00_Grid4_StartDate');

We have tried using the following which exposes some features but we still can't seem to set nor get the value from the web slider using BLOCKED SCRIPT

var webSlider = document.getElementById('ctl00_ContentPlaceHolder1_UltraWebTab2__ctl4_UltraWebGrid5_ctl00_Grid5_WebSlider');

We've tried to access the CSOM functions but can't seem to connect the WebSlider object to them (Error: Object doesn't support this property or method)

Any suggestions would be most appreciated,

D Reinhart

  • 24497
    posted

    Hi D Reinhart,

    If javascript-based control is located in naming-container, then under dot-net using hardcoded value is not reliable. For now id-separator is "_", but a new version of dot-net may change that value and your codes will fail. For example, id-separator for UniqueID used to be ":", but now it is "$".

    You may consider 2 of possible options:

    1. Process Initialize ClientSideEvent and create a global member variable which will contain value of ClientID. Use that global variable when you need to get reference to control.

    2. Use <%=Control.ClientID%>.
    var slider = $find('<%=WebSlider1.ClientID%>');
    var dateChooser = igdrp_getComboById('<%=StartDate.ClientID%>');
    window.alert(
    'slider:' + slider + ' dc:' + dateChooser);