Results 1 to 5 of 5

Thread: Refreshing an Ext.window on its button click

  1. #1

    Default Refreshing an Ext.window on its button click

    Dear Friends,

    Again seeking ur help as i am new this ExtJs.

    I have a window .
    Code:
    var
    window = new Ext.Window({
    title: "STEP 1 : E-Form Template Creation", 
    width:650, 
    autoHeight: true,
    html: htmlData,
    y: 150,
    listeners: { 
    beforeclose: function () { 
    searchVisible = false; 
    } 
    },
    buttons: [
    { 
    text: 'Add', handler: function() {
    saveControl();
    }
    },
    {
    text:'Next', handler: function() {
    window.close();
    showCustomDialog();
    }
    }
    ] 
    });
     
    window.show(this);
    when i click on the add button i am calling the following method
    Code:
    function saveControl(){
     
    eformName= $("#eformName").val();
    alert(eformName);
    controlType= $("#controlType").val();
    labelName= $("#labelName").val();
    dataType= $("#dataType").val();
    required= $("#required").val();
     
    var itemList = []; 
    $("#selectedItemLists option").each(function(){
    itemList.push($(this).val()); 
    alert(itemList);
    }); 
     
    alert(eformName);
     
    data = "eform_name=" + eformName + "&control=" + controlType + "&labelName=" +labelName+ "&dataType=" +dataType+"&required="+required+"&items="+itemList;
     
    alert(data);
     
    $.ajax( {
    type : "POST",
    url : "/ajax/eformDetails/save.do",
    data : data,
    cache : false,
    dataType : "text/html",
    timeout: 20000,
    beforeSend : function() {
    showWaitingDialog("Please wait...");
    },
    error: function (xhr, err)
    {
    resolveAjaxError(xhr, err);
    },
    success : function(data) {
     
    //this.window.doLayout();
     
    }
    }); 
     
    }
    the data coming from the controller is same and now i want to refresh the window.
    on success method.

    Please help me in this as it is very urgent.
    seeking your help.

    Thanks in advance.

    Regards,
    Sathya

  2. #2
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895

    Default

    Visit the Ext.Window API documentation and look at the load() method.

  3. #3

    Default

    Hi friend,

    Thanks you for this .

    I am still not aware of how to use this.

    could you please give me an example?

    Regards,
    sathya

  4. #4

    Default

    Help me

  5. #5
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895

    Default

    If you haven't already, open the documentation link, click the triangle to the left of the load() method to open the comments section and you'll see an actual code sample.

    The function specified via callback will allow you to get at the response and do anything specific to your needs:

    Code:
    callback: function(el, success, response, options) {
     // do something whacky here.
    }

Similar Threads

  1. New Ext.Window on Button Click
    By nitesh35103 in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 14 Jun 2012, 11:39 PM
  2. How to refresh browser window on click of the button
    By sathishb in forum Ext GWT: Discussion
    Replies: 5
    Last Post: 18 Feb 2011, 10:16 AM
  3. window not displaying on button click
    By talap01 in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 29 Dec 2010, 11:11 PM
  4. Refreshing Grid Data on Button Click where store is in separate js file
    By progress2 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 17 Apr 2010, 4:15 PM
  5. asp.net: How to use a window as an on button click modal dialog
    By jonx in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 14 Mar 2008, 4:22 AM

Posting Permissions

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