Results 1 to 10 of 10

Thread: reloading a panel

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Cool reloading a panel

    hi all,

    i have a small problem with reloading a panel.
    what i need is ,
    when i click on the 'cancel' button, every fields in that panel should be reloaded.
    i searched for reloading a panel. bt i cant find anything.
    so i tried to remove all the contents and add the panel once more. but the panel is not showing.
    anyone help me plz........

    Code:
    {
    region: 'center',
    id: 'centre-panel',
    xtype: 'panel',
    frame: true,
    items: [
    {
    xtype: 'tabpanel',
    activeTab: 2,
    items: [
    {
    title: 'Home',
    frame: true,
    items: [
    homePanel
    ]
    },
    {
    title: 'Profile',
    frame: true,
    items: [
    //
    ]
    },
    {
    title: 'Add Remarks',
    id: 'remarks-panel',
    frame: true,
    items: [
    commentsPanel
    ],
    buttons: [
    {
    text:"Save",
    handler: function()
    {
    }
    },
    {
    text:"Cancel",
    handler: function()
    {
    Ext.getCmp('remarks-panel').removeAll();
    Ext.getCmp('remarks-panel').add(commentsPanel);
    Ext.getCmp('remarks-panel').doLayout(); 
    }
    }
    ]
    }
    ]
    }
    ]
    }
    thanks in advance...
    cRaZy

  2. #2
    Ext User
    Join Date
    Aug 2009
    Posts
    127

    Default

    What do mean with reloading the panel? Do you perhaps want to reload a grid inside the panel (or other data)?

  3. #3
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Default panel reload

    ya
    actualy i want is to reload all the contents in the panel
    that commentsPanel is a panel(Ext.Panel), which contains 2 formPanels(containing some text fields).
    so when i click the 'cancel' button, all the fields want to be refreshed.

  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Ger
    Posts
    178

    Default

    do u load data from server when u click "cancel" button? or do u want to set some kind of default values ?

  5. #5
    Ext User
    Join Date
    Aug 2009
    Posts
    127

    Default

    ok so resetting each field should work, right? I am not sure if there is another / easier way to do it.

  6. #6
    Ext User
    Join Date
    Oct 2008
    Location
    Ger
    Posts
    178

    Default

    don't know if there is an easyier way, u can change the value like this:

    FIELDNAME.setValue('test');

  7. #7
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Cool thanks

    ok thanks for the replies....

    but in the foll code, will u plz say how can i set the value

    Code:
    var commentsPanel1 = new Ext.form.FormPanel({ 
    frame:true, 
    width: 500,
    autoHeight: true,
    defaultType:'textfield',
    labelWidth: 200,
    monitorValid:true,
    items:[
    { 
    fieldLabel: '<b>Label1</b>',
    id: 'label1_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label2</b>',
    id: 'label2_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label2</b>',
    id: 'label2_id',
    width:190
    },
    { 
    fieldLabel: '<b>Label3</b>',
    id: 'label3_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label4</b>',
    id: 'label4_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label5</b>',
    id: 'label5_id',
    width:190,
    allowBlank: false
    }
    ],
    buttons: [
    {
    text: 'Submit',
    handler: function(){
    'label2_id'.setValue('hi');
    alert('label1_id'.getValue());
    }
    }
    ],
    renderTo: document.body
    });

    Code:
    //'label2_id'.setValue('hi');
    //alert('label1_id'.getValue());
    both lines shows some error
    what may be the error....

    thanks in advance
    cRaZy...

  8. #8
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Cool thanks

    ok thanks for the replies....

    but in the foll code, will u plz say how can i set the value

    Code:
    var commentsPanel1 = new Ext.form.FormPanel({ 
    frame:true, 
    width: 500,
    autoHeight: true,
    defaultType:'textfield',
    labelWidth: 200,
    monitorValid:true,
    items:[
    { 
    fieldLabel: '<b>Label1</b>',
    id: 'label1_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label2</b>',
    id: 'label2_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label2</b>',
    id: 'label2_id',
    width:190
    },
    { 
    fieldLabel: '<b>Label3</b>',
    id: 'label3_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label4</b>',
    id: 'label4_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label5</b>',
    id: 'label5_id',
    width:190,
    allowBlank: false
    }
    ],
    buttons: [
    {
    text: 'Submit',
    handler: function(){
    'label2_id'.setValue('hi');
    //alert('label1_id'.getValue());
    }
    }
    ],
    renderTo: document.body
    });

    Code:
    'label2_id'.setValue('hi');
    //alert('label1_id'.getValue());
    both lines shows some error
    what may be the error....

  9. #9
    Sencha User
    Join Date
    Jul 2009
    Posts
    50

    Cool field value

    ok thanks for the replies....

    but in the foll code, will u plz say how can i set the value

    Code:
    var commentsPanel1 = new Ext.form.FormPanel({ 
    frame:true, 
    width: 500,
    autoHeight: true,
    defaultType:'textfield',
    labelWidth: 200,
    monitorValid:true,
    items:[
    { 
    fieldLabel: '<b>Label1</b>',
    id: 'label1_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label2</b>',
    id: 'label2_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label2</b>',
    id: 'label2_id',
    width:190
    },
    { 
    fieldLabel: '<b>Label3</b>',
    id: 'label3_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label4</b>',
    id: 'label4_id',
    width:190,
    allowBlank: false
    },
    { 
    fieldLabel: '<b>Label5</b>',
    id: 'label5_id',
    width:190,
    allowBlank: false
    }
    ],
    buttons: [
    {
    text: 'Submit',
    handler: function(){
    'label2_id'.setValue('hi');
    alert('label1_id'.getValue());
    }
    }
    ],
    renderTo: document.body
    });

    Code:
    'label2_id'.setValue('hi');
    //alert('label1_id'.getValue());
    both lines shows some error
    what may be the error....

  10. #10
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Cool

    @crazy --

    Why are you acting crazy?
    Why do you keep posting the same message every 5+ minutes?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •