1. #1
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    0
    atul.sachan@capgemini.com is on a distinguished road

      0  

    Default Unanswered: How to minimize Ext Window

    Unanswered: How to minimize Ext Window


    I am opening Ext.window as a popup and trying to minimize but minimize button is not working.
    -------------
    Ext.define('com.gm.vl.view.reports.CustomerReportView', {
    extend: 'Ext.window.Window',
    alias : 'widget.CustomerReport',
    height: 560,
    width : 990,
    minimizable :true,
    maximizable: true,
    id:'custreport',
    //autoScroll:true,
    listeners: {
    minimize: function(win,obj) {


    }
    },
    ---------------------------------
    any thoughts on this ??? please

    Thanks
    AS

  2. #2
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Vote Rating
    27
    Answers
    106
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    From the API Documentation for Ext.window.Window:

    True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button and disallow minimizing the window. Note that this button provides no implementation -- the behavior of minimizing a window is implementation-specific, so the minimize event must be handled and a custom minimize behavior implemented for this option to be useful.

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    0
    atul.sachan@capgemini.com is on a distinguished road

      0  

    Default


    I have read this already, could you provide any sample code for minimizing the window.
    Tried this code but not working on click of minimize button because 'minimize' event occurs after window has been minimized.
    //////////////////
    listeners: {
    minimize: function(win,obj) {
    win.minimize( )
    }
    //////////////
    AS

  4. #4
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Vote Rating
    27
    Answers
    106
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    Calling win.minimize() inside the minimize event simply fires the minimize event again, where you may be causing event recursion...

    From the API docs for the Window.minimize() function:

    Placeholder method for minimizing the window. By default, this method simply fires the minimize event since the behavior of minimizing a window is application-specific. To implement custom minimize behavior, either the minimize event can be handled or this method can be overridden.
    It's up to you to decide what a 'minimize' event means in terms of your window and supply the code accordingly.

    Do you want a small icon to appear near the bottom right corner of a panel, to indicate a 'minimized' window? If so, then you have to code that...

  5. #5
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    0
    atul.sachan@capgemini.com is on a distinguished road

      0  

    Default


    Simply i wanted to minimize the Window on click of minimize button. Could you provide any sample code?
    AS

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,067
    Vote Rating
    659
    Answers
    471
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    What the docs are saying is that "minimize" doesn't ~mean~ anything. For example, in Windows you have a taskbar, so "minimize" means send the item to the taskbar. In the case of your application, that behaviour may not make sense, so you need to implement whatever minimize means for your application.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Ext JS Premium Member
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    0
    atul.sachan@capgemini.com is on a distinguished road

      0  

    Default


    This is my window, but minimize is not working here, if i am doing any thing wrong here then please let me know.
    //////////////////////////////////////////////////////
    Ext.define('com.gm.vl.view.reports.CustomerReportView', {
    extend: 'Ext.window.Window',
    alias : 'widget.CustomerReport',
    height: 560,
    width : 990,
    minimizable :true,
    maximizable: true,
    id:'custreport',
    //autoScroll:true,
    listeners: {
    minimize: function(win,obj) {



    }
    },
    initComponent: function() {
    var me = this;
    Ext.applyIf(me, {
    items: [

    {xtype: 'panel',
    border : 0,

    items: [
    {
    xtype : 'panel',
    // width : 940,
    html : '<span class='+styleData.whiteLabel+' style="margin-left:850px;valign : "middle"> <a href="http://10.156.1.87:7003/vl_web/VehicleReportPDF?View='+ Ext.getCmp('viewID').getValue()+'" onclick="window.open(this.href,width=1000,height=1000);return false;" target="target"> <img src="images/PrintIconNew.jpg"> </img> </a> <img src="images/Help.gif"></img></span>',
    bodyStyle : {background: '#003366'},
    border : 0,
    height : 30,
    style : {
    marginTop :'5px',
    marginBottom :'10px',
    marginLeft :'10px',
    background : '#003366'
    }
    }]
    },
    {
    xtype: 'panel',
    border : 0,
    height : 50,
    layout: {
    type: 'column'
    },
    items: [

    { xtype: 'combobox',
    width: 160,
    store: 'DViewTypeStore',
    displayField: 'name',
    valueField: 'value',
    editable : false,
    value : 'Detail',
    mode : 'local',
    fieldLabel:'Report type',
    action :'summarydetail',
    labelWidth :70,
    style : {
    marginLeft : '645px'
    }
    },

    { xtype: 'combobox',
    width: 160,
    store: 'DealerDataStore',
    displayField: 'name',
    valueField: 'value',
    editable : false,
    value : 'Customer',
    mode : 'local',
    fieldLabel:'Report for',
    action :'summarydetail',
    labelWidth :70,
    style : {
    marginLeft : '10px'
    }
    }
    ]},

    {}
    ]
    });


    me.callParent(arguments);
    },
    minimize: function() {
    this.fireEvent('minimize', this);
    return this;
    }
    });
    ////////////////

    Thanks
    AS

  8. #8
    Sencha User
    Join Date
    Oct 2012
    Posts
    4
    Vote Rating
    0
    veladitya is on a distinguished road

      0  

    Default any luck on this ...

    any luck on this ...


    am also looking for the same kind of requirement,.... can anyone...help me out....

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,067
    Vote Rating
    659
    Answers
    471
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Please read what I wrote above. You need to implement minimize behaviour.

    Assume you have a normal webpage. What does it mean to "minimize" a window?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  10. #10
    Touch Premium Member suzuki1100nz's Avatar
    Join Date
    Apr 2011
    Location
    New Zealand
    Posts
    450
    Vote Rating
    66
    Answers
    21
    suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice suzuki1100nz is just really nice

      1  

    Default


    What do YOU want to happen with a window minimize?
    There is no task bar to put the window in as your app is running in a browser whatever you decide for your application you have to code the behavior Sencha cant do that for you.

    An idea is a simple task bar rip off - Have a toolbar at the bottom or your app, when a window is minimized place a proxy button into the toolbar with the name of the window.
    When a user clicks on the button re open the window and remove the button.