Below script will lets you to open Ext.Panel (that is Panel) onClick of an anchor link. Its really a simple snippet and this will help developers those who are new to Ext JS. Mostly I will be posting these types of snippets as it helps people in learning some new and small tricks on how we can use respective method or event accordingly.
Before looking at the below code just download the respective Ext JS 2.2 SDK on your desktop and just download the below tutorial and save it to this location: ExtJS2.2\examples\panel this is because I have not changed the respective relative paths.
Live Preview | Download
HTML Code:
Below is the code were you need to place it in the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script> <script type="text/javascript" src="../../ext-all.js"></script> <link rel="stylesheet" type="text/css" href="../shared/examples.css" /> <style type="text/css"> .x-panel-body p { margin:10px; } #container { padding:10px; } </style> |
JavaScript Code:
JavaScript Code should be placed below this line
1 |
<script type="text/javascript" src="../../ext-all.js"></script>
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Ext.onReady(function(){ var mypanel = new Ext.Panel({ title: 'My Panel', collapsible:true, width:500, html: Ext.example.bogusMarkup }); var myButton = Ext.get('myHrefIdClick'); myButton.on('click', function(){ //render the panel to id -> 'container' mypanel.render('container'); }); }); //onReady Close |
Below code should be placed in
… tag:
1 2 3 4 5 |
<script type="text/javascript" src="../shared/examples.js"></script> <h1>onClick of a link opens up a Panel</h1> <a href="#" id="myHrefIdClick">Click Here</a> <div id="container"> </div> |
If you would like to view the preview, you can click the below link:
Live Preview | Download
Articles which you would like to read:
Related Entries...
-
Hi guys! I am back with some useful stuff after my Christmas holidays, in this article you can learn ...
-
Introduction Below is the simple snippet which allows us to show or hide the Ext.Window panel, on bu ...
-
I think everybody those who are in web development environment or those who are in the other areas of ...
-
Introduction: When I was working on Ext JS Tab Panels, I was strucked at one position like, let me e ...
-
Introduction: Date Ranging is simple using ExtJS DateField. Yes! When I was working for one of my pr ...
-
Good news for all designers and developers, awesome new Ext Designer Desktop Tool has been released n ...
-
Introduction: This is one of the good example on how we can load a ThickBox (Example: ThickBox relat ...
-
This is a simple cross-browser snippet to open an e-mail message window onclick of a button using Jav ...
-
All Ext GWT users here is a good news, now Ext GWT 1.2 has been released (means the Ext GWT 1.1 has b ...
-
Below snippet code helps you in getting mouse coordinates inside a div container, when user moves mou ...
One Response
Its not working for me in Firefox when i click i doesn’t do anything.