1. #11
    Sencha User
    Join Date
    Jan 2011
    Posts
    546
    Vote Rating
    53
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    As we already know, you can't put one formPanel inside another - therefore you probably have two options:

    1.) Think of a way to alter your layout so these two sections can co-exist inside their own separate forms.

    2.) Manually handle all the formfields within your "tabpanel1" and submit these via an AJAX call instead of a form submit (i.e. give all your fields IDs or loop through the panel's items object, grab the input values one by one, then submit these as your AJAX params).

  2. #12
    Sencha User
    Join Date
    Dec 2010
    Location
    Toronto
    Posts
    62
    Vote Rating
    1
    thomsonzh is on a distinguished road

      0  

    Default


    I will try your second solution. Do you have any panel's items object loop code for share?
    Cheers,

  3. #13
    Sencha User
    Join Date
    Jan 2011
    Posts
    546
    Vote Rating
    53
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    I'm not at my computer right now so will be writing this code blind, but it would be something like this (assuming you have a panel populated with form inputs):

    Code:
    var params = {};
    var items = panel.items.items;
    Ext.each(items, function(i, input){
      var name = input.name:
      var value = input.value;
      params.push("' + name + '":"' + value + '")
    }
    // now use your params object in your AJAX call
    Apologies if there are errors - writing this on a phone isn't so easy!

    EDIT:
    Actually you won't use .push(), I think inside the each loop you'll just need to do this instead:
    Code:
    params[input.name] = input.value;

  4. #14
    Sencha User
    Join Date
    Dec 2010
    Location
    Toronto
    Posts
    62
    Vote Rating
    1
    thomsonzh is on a distinguished road

      0  

    Default


    It looks nice code.Thanks you willigogs.

Thread Participants: 1