jQuery UI Widgets Forums Layouts Splitter Get Splitter state after initialized and trigger respective events

This topic contains 2 replies, has 2 voices, and was last updated by  raj 4 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • raj
    Participant

    Hi,

    I’ve used the splitter and kept it in collapsed state during page ready. Based on the splitter states during page ready, I’ll Show & Hide some of the elements inside both the panels respective to the panel size.

    Though I kept the splitter in collapsed state, the “collapsed” event or “resize” event is not getting called. Below is the code snippet for reference,

    $(document).ready(function()
    {
    	$('#mainSplitter').jqxSplitter({
    		width: "100%",
    		height: "100%",
    		panels: [{size: "42%", collapsible: false, min: 230},{size: "58%"}]
    	});
    
    	$('#mainSplitter').jqxSplitter('collapse');
    
    	$('#mainSplitter').on('collapsed', function (event) {
    		alert('Alert when collpased');
    	});
    
    	$('#mainSplitter').on('expanded', function (event) {
    		alert('Alert when expanded');
    	});
    
    	$('#mainSplitter').on('resize', function (event) {
    		alert('Alert when resized');
    	});
    });

    I want the respective events to be get triggered once after the page load or once after the splitter state is set.

    Can someone suggest me a solution on how to achieve?

    Thanks,
    Raj


    Peter Stoev
    Keymaster

    Hi Raj,

    They will not be trigged because you bound to events in your code AFTER you call a method like “collapse”. For reference, look at the Splitter’s API Demos.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    raj
    Participant

    Hi Peter,

    Thanks for your quick turnaround & it helps me. Now it is working fine.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.