-
23 Jul 2008 10:21 PM #31
jbum,can you provide the actual code?
By the way, anyone can explain to me what the variable newTools in following code means? (I think it is not necessary!)
Code:Ext.ux.MaximizeTool = function() { this.init= function(ct) { var maximizeTool = { id: 'maximize', handler: handleMaximize, scope: ct, qtip: 'Maximize' }; ct.tools = ct.tools || []; var newTools = ct.tools.slice(); ct.tools =newTools; ...Last edited by mystix; 23 Jul 2008 at 10:29 PM. Reason: post code in [code][/code] tags. refer to http://extjs.com/forum/misc.php?do=bbcode
-
7 Jul 2009 2:35 PM #32
Hi,
This is really useful. Thanks!
How would I call the minimize function? I have a grid in the portlet and when I click on a row I need to do an action and minimize the max window.
I am calling the plugin like:
plugins : new Ext.ux.MaximizeTool()
Thanks, Marty
-
4 Aug 2009 11:56 PM #33
this plug-in has been very helpful. Many thanks!
Now I am trying to modify it a little bit to display some extra hidden columns in the maximized panel.
Unfortunately the panel does not seems to get refreshed (take the new columns into account) and the previously hidden columns are not visible because its width is 0 or close to it.PHP Code:function handleMaximize(event, toolEl, panel){
panel.originalOwnerCt = panel.ownerCt;
panel.originalPosition = panel.ownerCt.items.indexOf(panel);
panel.originalSize=panel.getSize();
// Display hidden Columns
var columns = panel.getColumnModel().getColumnsBy(function(c){
return c.hidden;
});
for(var i=0, len=columns.length;i<len;i++) {
columns[i].hidden = false;
}
panel.getView().fitColumns(false);
panel.getView().updateAllColumnWidths();
panel.doLayout();
// End of modifications
if (!toolEl.window) {
var defaultConfig = {
id: (panel.getId() + '-MAX'),
width: (Ext.getBody().getSize().width - 100),
height: (Ext.getBody().getSize().height - 100),
resizable: true,
draggable: true,
closable: true,
closeAction: 'hide',
hideBorders: true,
plain: true,
layout: 'fit',
autoScroll: false,
border: false,
bodyBorder: false,
frame: true,
pinned: true,
bodyStyle: 'background-color: #ffffff;'
};
toolEl.window = new Ext.Window(defaultConfig);
toolEl.window.on('hide', handleMinimize, panel);
}
if (!panel.dummyComponent) {
var dummyCompConfig = {
title: panel.title,
width: panel.getSize().width,
height: panel.getSize().height,
html: ' '
};
panel.dummyComponent = new Ext.Panel(dummyCompConfig);
}
toolEl.window.add(panel);
if (panel.tools['toggle']) panel.tools['toggle'].setVisible(false);
panel.tools['maximize'].setVisible(false);
panel.originalOwnerCt.insert(panel.originalPosition, panel.dummyComponent);
panel.originalOwnerCt.doLayout();
panel.dummyComponent.setSize(panel.originalSize);
panel.dummyComponent.setVisible(true);
panel.dummyComponent.getEl().mask('This is maximized.');
toolEl.window.show(this);
};
This is my panel grid code, which is inside a viewport with a fit layout:
PHP Code:// create the Grid
var grid = new Ext.grid.GridPanel({
store: pagingProxyStore, //2.3
itemId: 'maxTable',
columns: [
{id:'procId', header: "", width: 25, fixed: true, dataIndex: 'procId', renderer: renderSubtypeAndBasculement},
{header: "", width: 25, fixed: true, dataIndex: 'procId', renderer: renderClassIcon},
{header: "Auteur", width: 50, sortable: true, dataIndex: 'auteur'},
{header: "Référence Interne", width: 150, sortable: true, dataIndex: 'refDg'},
{header: "Réceptionnée le", width: 100, sortable: true, dataIndex: 'modifDate', renderer: Ext.util.Format.dateRenderer('d/m/Y')},
{header: "State", width: 100, sortable: true, dataIndex: 'state', hidden: true},
{header: "", width: 25, fixed: true, dataIndex: 'procId', renderer: renderPrintLink},
{header: "", width: 25, fixed: true, dataIndex: 'procId', renderer: renderUseLink}
],
stripeRows: false,
collapsible: true,
autoHeight: true,
iconCls: 'icon-page',
border: false,
plugins: [
new Ext.ux.MaximizeTool(),
new Ext.ux.grid.AutoSizeColumns()
],
viewConfig: {
forceFit: true,
scrollOffset: 0,
getRowClass: function(record, index){
return (record.data.procType + '-row');
}
},
bbar: pagingToolBar
});
I have been searching in the forums and trying different suggestions but I did not find a solution.
Please, help me. I am a newbie and still have a lot to learn
-
8 Aug 2009 8:52 AM #34
-
15 Sep 2009 3:31 AM #35
Did someone test this plugin on ExtJS 3.0?
-
3 Dec 2009 10:06 PM #36
Thanks Ram Krishna, It worked for me. I was doing maximizing in another way, but this is nice. I am switching to it. And thanks again.
-
3 Dec 2009 10:13 PM #37
-
4 Mar 2010 7:39 AM #38
destroy dummycomponent for panel
destroy dummycomponent for panel
In the below pulgin, when I minimize the panel , I also want to destroy the dummy panel component. I have added this line to minimize handler, this.dummyComponent.destroy();
But i still get an object in panel.dummyComponent when i try to maximize the panel for second time. is there any way i can get rid of this dummy component and recreate it everytime I maximize the panel.
Code:Ext.ux.MaximizeTool = function() { this.init= function(ct) { var maximizeTool = { id: 'maximize', handler: handleMaximize, scope: ct, qtip: 'Maximize' }; ct.tools = ct.tools || []; var newTools = ct.tools.slice(); ct.tools =newTools; for(var i=0, len=ct.tools.length;i<len;i++) { if (ct.tools[i].id=='maximize') return; } ct.tools[ct.tools.length] = maximizeTool; }; function handleMaximize(event, toolEl, panel){ panel.originalOwnerCt = panel.ownerCt; panel.originalPosition = panel.ownerCt.items.indexOf(panel); panel.originalSize=panel.getSize(); if (!toolEl.window) { var defaultConfig = { id: (panel.getId() + '-MAX'), width: (Ext.getBody().getSize().width - 100), height: (Ext.getBody().getSize().height - 100), resizable: true, draggable: true, closable: true, closeAction: 'hide', hideBorders: true, plain: true, layout: 'fit', autoScroll: false, border: false, bodyBorder: false, frame: true, pinned: true, bodyStyle: 'background-color: #ffffff;' }; toolEl.window = new Ext.Window(defaultConfig); toolEl.window.on('hide', handleMinimize, panel); } //alert(panel.dummyComponent); if (!panel.dummyComponent) { var dummyCompConfig = { title: panel.title, width: panel.getSize().width, height: panel.getSize().height, html: ' ' }; panel.dummyComponent = new Ext.Panel(dummyCompConfig); } toolEl.window.add(panel); if (panel.tools['toggle']) panel.tools['toggle'].setVisible(false); panel.tools['maximize'].setVisible(false); panel.originalOwnerCt.insert(panel.originalPosition, panel.dummyComponent); panel.originalOwnerCt.doLayout(); panel.dummyComponent.setSize(panel.originalSize); panel.dummyComponent.setVisible(true); panel.dummyComponent.getEl().mask('This is maximized.'); toolEl.window.show(this); }; function handleMinimize(window) { this.dummyComponent.getEl().unmask(); this.dummyComponent.setVisible(false); this.originalOwnerCt.insert(this.originalPosition, this); this.originalOwnerCt.doLayout(); this.setSize(this.originalSize); this.tools['maximize'].setVisible(true); if (this.tools['toggle']) this.tools['toggle'].setVisible(true); this.dummyComponent.destroy(); } };Last edited by mystix; 5 Mar 2010 at 7:13 AM. Reason: POST CODE IN [code][/code] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code
-
8 Mar 2010 8:28 AM #39
Possible to use in TabPanel?
Possible to use in TabPanel?
Has anyone had success with this UX in a tab panel? Out of the box implementation inserts a new blank tab on minimize instead of adding the maximized grid back into the tab it was originally contained in.
-
6 May 2010 7:32 AM #40
Data missing when we close the panel
Data missing when we close the panel
hi,
Panel maximize is working for me. but If I click the close button the panel . panel closed and the data are missing.
Thanks,
Raja S


Reply With Quote


