jQWidgets Forums
Forum Replies Created
-
Author
-
Hi Alex,
After you’ve initialized your expander you can use the following code to change user interaction’s type for collapsing/expanding:
$('#expander').jqxExpander('toggleMode', 'dblclick');
Best regards,
Minko.
October 14, 2011 at 12:48 pm in reply to: Expand/collapse item programmatically Expand/collapse item programmatically #976Hi Alex,
The jqxNavigationbar has methods “expandAt” and “collapseAt”. If the jqxNavigationbar is in single expanded item mode you can use the following piece of code to expand any item (if you’re not expanding the current expanded item, the current expanded item is going to be collapsed):
$('#navigationBar').jqxNavigationBar('expandAt', index_to_expand);
If you’re in multiple expanded mode you can expand and collapse items with the following methods:
$('#navigationBar').jqxNavigationBar('expandAt', index_to_expand);$('#navigationBar').jqxNavigationBar('collapseAt', index_to_collapse);
Best regards,
Minko.
Hello Alex,
Yes you can do this by catching the “expanding” event. In the following code snippet you can see working example.
In your main page you’re initializing an expander:
<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <title>test</title> <link rel="stylesheet" href="js/css/jqx.css" type="text/css"/> <script type="text/javascript" src="Scripts/jquery-1.6.1.js"></script> <script type="text/javascript" src="js/jqxCore.js"></script> <script type="text/javascript" src="js/jqxExpander.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#expander').jqxExpander({ expanded: false }); $('#expander').bind('expanding', function (event) { $.ajax({ url: 'myData.txt', type: 'get', success: function (data) { $('#expander').jqxExpander('setContent', data); } }); }); }); </script></head><body> <div id="expander"> <div>Expander</div> <div></div> </div></body></html>
The file myData.txt for example is the content you wish to load.
Some text.
Best regards!
-
AuthorPosts