Piet van Zanten
WB 17: Splitter
February 04, 2013 02:59PM

As an addition to the little splitter project Michael Drechsler initiated, there's now a possibility to store the splitter position. You can download it here.
Because the splitting is all done in browser code the server does not "know" what position the splitter has.
So we need some Ajax to pass it to the server.
I created a server procedure, Ajax enabled, as follows:
PROCEDURE Save_SplitterPos(nPos)
The storing is done in an ini file for simplicity reasons, but you may want to change that to a database or any other more convenient way.
When the page is closed, we call this Ajax procedure in the browser Unload (on unload) code:
When the page is called we need to read (in the page global declarations or initialization code) the last position of the splitter:
nSplitterPos is a global int.
Now in the onload (browser) code of the page we set the splitterpos and do a call to the Move_Splitter procedure:
IF nSplitterPos<>0 THEN
   bMoving=True  //set the global boolean to true to enable the move
   Move_Splitter(nSplitterPos)  //do the move
   bMoving=False //reset the global boolean to false to stop move mode.
That's it, happy developping,


Edited 1 time(s). Last edit at 02/05/2013 12:44AM by Piet van Zanten.
Re: WB 17: Splitter
May 23, 2017 10:36PM
Do you still have the splitter? The link doesnot work anymore



Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.