jQuery UI Layout - is it possible to change attributes of panes AFTER they load?

976 Views Asked by At

I have a pane that it part of a set of panes created using the plugin jQuery UI Layout.

This pane has a "toggle" button with a certain height and width (I made it an obnoxious value just to demonstrate).

$('body').layout({
    applyDefaultStyles: true,
    east: {
        spacing_closed: 100, //toggler width
        spacing_open: 100,
        togglerLength_closed: 200, //toggler height (length)
        togglerLength_open: 200,
    }
});

I was wondering if / how I can modify the settings of that toggle button or anything else for that matter after the layout has already been instantiated. For example, on button.click(), I might want to set it's height/width to 0 so that the user cannot interact with it.

In my JS Fiddle I can access the layout and toggle a pane "Open" or "Closed" in a click handler function. However, I can't seem to change the attribute of it after it has been instantiated. Does anyone know how to do this?

Fiddle: http://jsfiddle.net/c92whe17/6/

1

There are 1 best solutions below

1
On BEST ANSWER

You were close. You can do:

testLayout.options.east.spacing_open = 20;

It doesn't update the UI until you toggle it though unless you can find some refresh method, so I'm just toggling it twice.

http://jsfiddle.net/jc3rj681/