EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: tslatt on November 23, 2011, 09:04:47 AM



Title: What is the proper way to update a panel's properties?
Post by: tslatt on November 23, 2011, 09:04:47 AM
Here's an easy question for once (I hope):

I've seen both of these methods, but I'm not sure which is the right way to update a panel's properties. If I want to collapse (or expand, close, open, maximize, restore) a panel, which of these lines of code is the proper way to do it? And what is the difference between the two?

Code:
$("#p").panel({ collapsed: true });
$("#p").panel("collapse");


Title: Re: What is the proper way to update a panel's properties?
Post by: stworthy on November 23, 2011, 06:21:24 PM
Call $('#p').panel({...}) will recreate the panel.
Call $('#p').panel(methodname, parameter) will perform action on the panel existed.


Title: Re: What is the proper way to update a panel's properties?
Post by: tslatt on November 29, 2011, 09:34:51 AM
OK, that makes sense. Thanks!