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
875
ExpandedStateChanged client side event not firing?
posted

Hello,
I have a web panel that is contained within a user control (essentially it's just a floating div tag that appears as a 'popup').  When the user has the popup visible and clicks to expand the webPanel, I would like the entire window to scroll down so that the webPanel is fully visible on the screen/centered.

To my web Panel, I have added:
<ClientSideEvents ExpandedStateChanged="WebPanel1_ExpandedStateChanged" ></ClientSideEvents>
 
On that same page I have added the javascript function that will handle the event:
 <script type="text/javascript" id="Infragistics">
function WebPanel1_ExpandedStateChanged(oWebPanel, oEvent) { 
if (oWebPanel != null) {
oWebPanel.scrollIntoView();
oWebPanel.focus();
}
}
</script>

However, it appears as though this event is not actually firing.  Is there anything that could be blocking this event?  I can't quite figure out what I'm doing wrong...  Any help would be great!  Thanks  :)

  • 995
    posted

    Hi,

    Actual event is firing with error.  The reason is the WebPanel doesn’t support scrollIntoView() function. The scrollIntoView method scrolls the HTML element into view. If you see the rendered page code, the control rendered as a HTML table. You will need to reference this table object and scroll it. You may use JavaScript function like:

    function ctl00_ExpandedStateChanged(oWebPanel, oEvent){

        var d = document.getElementById("WebUserControl1_WebPanel1");

        d.scrollIntoView(true);

    }