1. #1
    Ext User
    Join Date
    Oct 2007
    Posts
    48
    Vote Rating
    0
    cprabha is on a distinguished road

      0  

    Default Designing a Form on server side based on request

    Designing a Form on server side based on request


    Form layout needs to be designed using ext
    Layout, number of elements and type of elements in the page should be built

    dynamically - that means the values neeed to be fetched from the server side and

    based on certain conditions the fields should be rendered.

    Example:

    Let's say we need to display Student Details & Staff details in the same form based

    on the request.

    If the request is "Student", then we need to display 10 fields and the field names

    and values should be fetched from DB.
    If the request is "Staff", then we need to display 20 fields and the field names and

    values should be fetched from DB.

    Better if it is explained with an example

    Thanks in advance

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,114
    Vote Rating
    507
    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


    Ok, so... what's the question?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    141
    Vote Rating
    0
    armandoxxx is on a distinguished road

      0  

    Default


    my guess is .. "How to do it ..."

    I think you have to create an empty form

    after that make an ajax call and get needed field details ..

    create fields and add them to form ... since PanelForm is subclass of a form you can remove existing fields and add new ones in ..

    hope this helps ..

    bye

    Armando

  4. #4
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    Make an ajax request to the server which returns json containing an array of field definitions. In the ajax success handler, create the form panel, using the returned json as its items collection.

  5. #5
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,962
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    This thread may generate some ideas.
    "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.


  6. #6
    Ext User
    Join Date
    Oct 2007
    Posts
    48
    Vote Rating
    0
    cprabha is on a distinguished road

      0  

    Default Is it possible to build the Ext form in server side itself ?

    Is it possible to build the Ext form in server side itself ?


    s, the question is "How to do it..." . Thanks for your help.

    As you replied , the field details will be fetched from server side and the form building process will be handled in client side(java script).

    Is it possible to build the Ext form in server side itself ?
    ====================================================================
    Quote Originally Posted by armandoxxx View Post
    my guess is .. "How to do it ..."

    I think you have to create an empty form

    after that make an ajax call and get needed field details ..

    create fields and add them to form ... since PanelForm is subclass of a form you can remove existing fields and add new ones in ..

    hope this helps ..

    bye

    Armando

  7. #7
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,114
    Vote Rating
    507
    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


    Yes, it's most definitely possible. Generate the appropriate JSON on the server and send it back to the client.

    To make it easier, you may want to use/write your own JSON library to assist you.

    I even went so far as to create a simple .NET library to assist in creating Ext objects:

    Code:
    Panel p = new Panel();
    p.Title = "Foo";
    p.AutoWidth = true;
    Response.Write(p.ToJson());
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  8. #8
    Ext User
    Join Date
    Oct 2007
    Posts
    48
    Vote Rating
    0
    cprabha is on a distinguished road

      0  

    Default is it possible to define the panel in the server side itself ?

    is it possible to define the panel in the server side itself ?


    Thanks for your help. Have gone through the thread.

    Inference: The form panel is defined in the client side. And the fields can be built from server side on it.

    I need one more step to go.
    We need to decide which is to be used - whether form panel or grid or whatever, in the server side itself.

    is it possible to define the panel in the server side itself with its fields ?



    Quote Originally Posted by hendricd View Post
    This thread may generate some ideas.

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,114
    Vote Rating
    507
    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


    Technically, you could do EVERYTHING server side, example:

    Code:
    Ext.onReady(function()
    {
       var v = new Ext.Viewport();
       Ext.Ajax.request(
       {
          url: 'myLoader',
          success: function(response)
          {
             var o = Ext.decode(response.responseText);
             v.add(o);
             v.doLayout();
          }
       }
       );
    }
    );
    That assumes that say, o is a form panel declaration.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar