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
755
Splitter event for window resize
posted

I am missing a client resize event for the splitter.

The websplitter contains events for SplitBarPositionChanged and Collpase/Expand events. I use these events to resize 1 or 2 ultrawebgrids positioned in a SplitterPane. However when the user resizes the browser window the splitter resizes the panes. however I don't see a splitter event that I can use to resize my grids. I use the window.resize event, but that doesn't work, because sometimes the splitter resizes after I have tried to resize my grids.

Do you have a solution?

Parents
No Data
Reply
  • 24497
    posted

    Hi,

    ClientEvent expose events related to splitter, but not events related to events triggered by external control (like parent of splitter). The splitter has public member layout() which called when control is resized or application wants to resize control. So, in theory you may hack into splitter and filter that method (no support in case of misbehavior).

    Below is example:

    <script type="text/javascript">
    function
    initSplitter(splitter)
    {
      splitter._oldLayoutMember = splitter.layout;
      splitter.layout =
    function(width, height)
      {
       
    this._oldLayoutMember(width, height);
        raiseMyLayoutEvent(splitter);
      }
    }
    function raiseMyLayoutEvent(splitter)
    {
      alert(
    "splitter was resized");
    }
    </script>

    <ig:WebSplitter ID="WebSplitter1" runat="server" Height="133px" Width="50%">
     
    <Panes>
     
    <ig:SplitterPane runat="server"></ig:SplitterPane>
      <ig:SplitterPane runat="server"></ig:SplitterPane>
     
    </Panes>
     
    <ClientEvents Initialize="initSplitter" />
    </ig:WebSplitter>

Children