3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">Ext.onReady(function(){
\r
10 // NOTE: This is an example showing simple state management. During development,
\r
11 // it is generally best to disable state management as dynamically-generated ids
\r
12 // can change across page loads, leading to unpredictable results. The developer
\r
13 // should ensure that stable state ids are set for stateful components in real apps.
\r
14 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
\r
16 // create some portlet tools using built in Ext tool ids
\r
19 handler: function(){
\r
20 Ext.Msg.alert('Message', 'The Settings tool was clicked.');
\r
24 handler: function(e, target, panel){
\r
25 panel.ownerCt.remove(panel, true);
\r
29 var viewport = new Ext.Viewport({
\r
41 cmargins:'35 5 5 5',
\r
47 html: Ext.example.shortBogusMarkup,
\r
54 html: Ext.example.shortBogusMarkup,
\r
65 style:'padding:10px 0 10px 10px',
\r
67 title: 'Grid in a Portlet',
\r
70 items: new SampleGrid([0, 2, 3])
\r
72 title: 'Another Panel 1',
\r
74 html: Ext.example.shortBogusMarkup
\r
78 style:'padding:10px 0 10px 10px',
\r
82 html: Ext.example.shortBogusMarkup
\r
84 title: 'Another Panel 2',
\r
86 html: Ext.example.shortBogusMarkup
\r
90 style:'padding:10px',
\r
94 html: Ext.example.shortBogusMarkup
\r
96 title: 'Another Panel 3',
\r
98 html: Ext.example.shortBogusMarkup
\r
103 * Uncomment this block to test handling of the drop event. You could use this
\r
104 * to save portlet position state for example. The event arg e is the custom
\r
105 * event defined in Ext.ux.Portal.DropZone.
\r
108 // 'drop': function(e){
\r
109 // Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' +
\r
110 // e.columnIndex + '<br />Position: ' + e.position);
\r