I am using jquery.layout-1.2.0 by Fabrizio Balliano
i want to know in my java script whether a Layout Pane is in open state or closed state.
As per documentation i tried the following.
var lout = $('body').layout();
// get layout 'state'
var is_west_open = lout.state.west.isOpen;
alert(is_west_open);
if (!is_west_open)
outerLayout.toggle('west');
Alert is returning ‘Undefined‘
What did i miss?
That’s right. There’s no duplicate property
isOpen. UseNOT isClosedinstead:I am not ready to answer why is there no property isOpen (I dont watch on this js-library), but I’d like to give you 2 advices:
1) Use
console.log(<variable>)instead ofalert(<variable>).alerthappens;toString()method, so it is not exactly the same object that browser operate with;2) Try to use Developer Tools in Google Chrome or Firebug (in Firefox) or, in Opera and IE their native inspectors – it can enshort the time you debug your application – they show you all the properties and methods available for an object
Just Click
F12and you’ll can see something like this:https://i.stack.imgur.com/JlSga.png