EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Hoffiric on September 28, 2015, 04:16:36 AM



Title: Center methods not available
Post by: Hoffiric on September 28, 2015, 04:16:36 AM
Hello

I've found the method(s) for centering windows in the doc, where it says they are available from version 1.3.1 on. I am running version 1.4.3 and yet these methods are nowhere to be found.

Code:
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#client_create').center();">Center window</a><br>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#client_create').window('close');">Close window</a>

<div id="client_create" class="easyui-window" data-options="title:'Create a client',inline:true,closable:false,iconCls:'icon-add'" style="width: 500px; height: 200px; padding: 10px">Test</div>

According to the documentation the center methods should be equally available as the window method that is being used to set certain properties. However the above example, where Close window works, Center window creates an error:

Quote
TypeError: $(...).center is not a function

So what's happening here!?

Thank you!


Title: Re: Center methods not available
Post by: stworthy on September 28, 2015, 08:17:59 PM
The 'center' method must be called as below:
Code:
$('#client_create').window('center');


Title: Re: Center methods not available
Post by: Hoffiric on September 29, 2015, 02:39:22 AM
Okay, note to self: methods are really just parameters for another method and not an actual method. thanks for clearing that up.