1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default Answered: Issue with Viewport treepanel and Resolution change for the UI

    Answered: Issue with Viewport treepanel and Resolution change for the UI


    Hello
    I am using viewport for laying out my app.Now I read that using anchor layout we can make the application fit into any resolution easily.

    I tried to use the documentation examples,but did not help.
    Here is what I have in the viewport,also adding the code.

    Another Issue:
    Height of the tree panel is not consistent as per the layout.The grid adjusts itself automatically to the resolution changes but the Tree panel just gets stuck.
    I am not able to figure out the issue.(New to designing a page and layout :P )

    Code:
     Ext.create('Ext.Viewport', {
            layout: 'border',
            title: 'Ext Layout Browser',
            items: [{
                xtype: 'box',
                id: 'header',
                region: 'north',
                html: '<h1> Ext.Layout.Browser</h1>',
                height: 30
            },{
                id: 'layout-browser',
                region:'west',
                border: false,
                split:true,
                margins: '2 0 5 5',
                width: 275,
                minSize: 100,
                maxSize: 500,
                items: [treePan]
            }, 
                grid_company
            ],
            renderTo: Ext.getBody()
        });
    Thanks

  2. Regarding grid column resizing, take a look at the forceFit property on Ext.grid.Panel. In my opinion, what you really need is autoScroll: true on the grid (or its parent container). This way your grid columns respect their configured width (for readability) and users with small screens can scroll horizontally to see the rest of the grid info.

    As for your login page's layout, I recommend using extreme caution with doing too much manual HTML/CSS layout. You run the risk of potentially breaking Ext's componet layout/styling.

    Having said that, I recommend you rethink the layout of your login page. I typically use an Ext.window.Window to contain my login form and keep it auto-centered on browser resize. This guarantees that a user can always see the login form centered in the window, regardless of resolution. I know this kinda 'cramps your style' regarding the logo/image layout on your home page, but it guarantees that your user can use the login page for its main, intended purpose: logging in.

    If you really want the login page logo to have prominence, add it the popup login window, either directly above or below the login fields. Again, if you keep the login Window centered on browser resize, you pretty much guarantee that the user can see the logo and the login form, regard of screen resolution (unless a user drags their browser size to a ridiculously small size).

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

      0  

    Default


    Try setting layout: 'fit' on your west region panel.

    Also, the renderTo attribute is not necessary and can be removed.

    P.S. I'm close to having the aforementioned demo app wrapped up. If all goes well, I'll have it ready by the middle of next week.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default


    1024x768grid.jpggrid1280x720.jpg

    Hello friend
    These are the screenshots for two different resolutions.
    1) 1024x768
    2) 1280x720


    Now if you look at the grid in the first image the columns don't shrink(columns after email not visible) to fit the layout like the second one.
    I think the columns of the grid should also shrink in size to adjust to the resolution.(Is it right/possible?)
    Code for entire layout is:

    Code:
     Ext.create('Ext.container.Viewport', {
            layout: 'border',
            renderTo: Ext.getBody(),
            items: [{
                region: 'north',
                autoHeight: true,
                border: false,
                margins: '2 2 0 5',
                width:250,
                items:[searchfield]    
            }, {
               
                layout:'fit',
                region:'west',
                border: false,
                split:true,
                margins: '2 0 50 5',
                width: 275,
                items: [treePan]
     
            },
                grid_company
            ]
        });
    Tree Panel:
    Code:
    var treePan=Ext.create('Ext.tree.Panel', {
                    id: 'candTree',
                    title: 'Navigation Menu',
                    region:'west',
                    split: true,
                    height: 440,
                    width: 'auto',
                   // minSize: 150,
                    autoScroll: true,
                    store: storetree
                    //frame:true
                
           });
    Grid panel
    Code:
     var pluginExpanded = true;                   
            var grid_company = Ext.create('Ext.ux.LiveSearchGridPanel', {            
                    store: store_company,
                    features: [groupingFeature],
                    id:'x-grid3-row-alt',
                    
                    remoteSort:false,
                    columns:[                     
                    {
                        text     : 'Client Name',
                        width    : 110,
                        sortable : true,
                        dataIndex: 'clientName',
                    },
                    {
                        text     : 'Requirement',
                        width    : 185,
                        sortable : true,
                        dataIndex: 'reqTitle',
                    },
    
               //Other Entries for grid columns.Removed for readability purpose
                ],
       
             // paging bar on the bottom
                bbar: Ext.create('Ext.PagingToolbar', {
                    store: store_company,
                    displayInfo: true,
                    displayMsg: 'Displaying topics {0} - {1} of {2}',
                    emptyMsg: "No topics to display",
                    items:[
                        '-', {
                        text: 'Show Preview',
                        pressed: pluginExpanded,
                        enableToggle: true,
                        toggleHandler: function(btn, pressed) {
                            var preview = Ext.getCmp('gv').getPlugin('preview');
                            preview.toggleExpanded(pressed);
                        }
                    }]
                }),
               // id:'candGrid', 
                //height:470,
                width: 'auto',
                title: 'Candidate List',
                margins: '1 5 35 0',
                region:'center',
                dockedItems: [{
                    xtype: 'toolbar',
                    dock: 'bottom',
                    ui: 'footer',
                    layout: {
                        pack: 'center'
                    },
                    items: [{
                        minWidth: 80,
                        text: 'Send Email',
                        /***********************handler for email***********************/    
                        handler : function(){      
                //handler for button
                                }
                                               
                        /**************************************************************/    
                    },{
                        minWidth: 80,
                        text: 'Send SMS',
                        /************************handler for sms button*********************/
                        handler : function(){      
                            
                //  handler for button
                                     }
                                            
                        /**************************************************************/
                            
                    }]
                }],
                //renderTo: 'grid-company',
                viewConfig: {
                                stripeRows: true
                            }        
            
            });
    Code:
    var searchfield = new Ext.form.TextField({
           id:'multisite-search-field',
           allowBlank: true,
         //  fieldLabel: 'Search',
           emptyText: 'Filter Requirements...',    
           width: 250,
         //  renderTo: 'search',
           listeners: {
                        
                        change: {
            
                        fn: function(p1,p2){
                               treefilter.searchTree(treePan,searchfield);  
                            }
                            
                        }
                 }//listener closed 
       });
    
    Thanks

  5. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default


    Even my index page has similar issue and its frustatng me that I am not able to fix it.(HTML is better is what i have started feeling).
    This is the js for it.
    Code:
    /*
     * This is the entry point into the application.As soon as the page is ready this is fired and the application is launched
     *
     */
    Ext.onReady(function(){
        //Outermost panel of teh page.
    
        var panelForm = new Ext.create('Ext.panel.Panel', {
            title: 'Welcome to New Astron Solutions',
            width: 'auto',
            height:450,
            frame:true,
            xtype:'panel',
            layout:'anchor',
          
            //html: '<img src="images/login_welcome_ce_bkgd.jpg" alt="Welcome" />',
           //renderTo: document.body.className(content)
            
         /**************************Form**************************************/
            items:[           
      {
        region:'east',
        bodyStyle:'padding:50px 45px 130px 840px',
        bodyCls: 'bodyImage',
    
        items:[
        Ext.create('Ext.form.Panel', {
        frame:true,
        title: 'LOGIN',
        bodyStyle:'padding:5px 5px 0',
          url:'j_spring_security_check',
        frame:true,
        id:'login',
        
        width: 280,
        //anchor:'200%',
        height:250,
            
        fieldDefaults: {
            labelAlign: 'top',
            msgTarget: 'top'         
        },
        items: [{
            xtype: 'container',
            anchor: '100%',
            layout:'column',
            items:[{
                xtype: 'container',
                columnWidth:.5,
                layout: 'anchor',
                items: [{
                    xtype:'textfield',
                    fieldLabel: 'User Name',
                    anchor:'170%',
                    name:'j_username',
                    height:'26px',
                    allowBlank:false    
                }, 
                {
                    xtype:'textfield',
                    fieldLabel: 'Password',
                    name:'j_password',
                    inputType:'password',
                    height:'26px',
                    allowBlank:false,
                    anchor:'170%'
                }]
            }]
        }],
    
        buttons: [{
        text:'Login',
        cls:'buttonLayout',
        overCls:'loginOver',
        iconCls:'loginButton',
        componentCls:'componentButton',
         style: {
             background:'#4093BA',
             marginTop: '70px',
             marginRight:'220px'
                  
         },
        formBind: true,
    handler:function(){
        // Function that fires when user clicks the button    
    
    }  
            /*******************************************************************/
    });
        panelForm.render('content');    
    });
    CSS styling:
    Code:
    body {
             background: url("images/body_bkgnd.png") repeat-x scroll left top #93C5E0;
             width:100%;
           }
           
      #logo {
        background-attachment: scroll, scroll;
        background-clip: border-box, border-box;
        background-color: transparent;
        background-image: url("images/logo.jpg"), none;
        background-origin: padding-box, padding-box;
        background-position: 0 0pt, 0 0;
        background-repeat: no-repeat;
        background-size: auto auto, auto auto;
        border: medium none;
        height: 50px;
        left: 31px;
        position: absolute;
        top: 12px;
        width: 165px;
    }               
    
    #content{
        border:solid red 0px;
        margin-top:70px;
        min-height:350px;
        overflow:true;
        margin-left:10px;
        margin-right:10px;
    }
    
    .bodyImage{
          background: url(images/login_welcome_ce_bkgd.jpg) 20px 40px;
          background-repeat: no-repeat;
          
    }
    
    .login{
        /*background: url(images/logo.jpg) center left no-repeat;*/
        
    }
    .loginButton{
        /*width:15px;
        height:20px;
        background-color:black;  
        font-size:20px;*/
        background: url(images/key.png) center left no-repeat;
        
    }
    
    .loginOver{
        color:black;     
    }
    
    .componentButton
    {
        padding:5px;
        
    }
    Here are the screenshots

    1024x768
    index1024x768.jpg

    1280x720
    index1280x720.jpg

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

      0  

    Default


    Regarding grid column resizing, take a look at the forceFit property on Ext.grid.Panel. In my opinion, what you really need is autoScroll: true on the grid (or its parent container). This way your grid columns respect their configured width (for readability) and users with small screens can scroll horizontally to see the rest of the grid info.

    As for your login page's layout, I recommend using extreme caution with doing too much manual HTML/CSS layout. You run the risk of potentially breaking Ext's componet layout/styling.

    Having said that, I recommend you rethink the layout of your login page. I typically use an Ext.window.Window to contain my login form and keep it auto-centered on browser resize. This guarantees that a user can always see the login form centered in the window, regardless of resolution. I know this kinda 'cramps your style' regarding the logo/image layout on your home page, but it guarantees that your user can use the login page for its main, intended purpose: logging in.

    If you really want the login page logo to have prominence, add it the popup login window, either directly above or below the login fields. Again, if you keep the login Window centered on browser resize, you pretty much guarantee that the user can see the logo and the login form, regard of screen resolution (unless a user drags their browser size to a ridiculously small size).

  7. #6
    Sencha User
    Join Date
    Nov 2011
    Posts
    149
    Answers
    2
    Vote Rating
    1
    sachintaware is on a distinguished road

      0  

    Default


    Yes friend I have done that currently,but I was suggested that that should be possible.I will definitely follow your instructions and work accordingly.
    Regarding the login page: Does it mean we can't have a better look and feel?Actually I had a simple login form as you said,but I was asked to give it a traditional look and feel.

    P.S : Regarding the,mail application,thanks for the efforts you have taken.Also,if possible can you let me know how can have attachments and velocity or any other mail template as I think these to be my next tasks.No need of the code your comments and links will also do for me.

    Thanks

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi