Hybrid View

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    119
    Vote Rating
    5
    drunkmoose is on a distinguished road

      0  

    Default Form question: What widget to use for that ?

    Form question: What widget to use for that ?


    Hi there!

    Here's an XML feed I have that's set up to feed a form:

    Code:
      <?xml version="1.0" encoding="iso-8859-1" ?> 
     <call>
     <call_details>
      <number>15590</number> 
      <description>[2010-09-21 11:49] Test</description> 
      <dateentered>2010-09-21 11:49</dateentered> 
      <priority>P1 (Critical)</priority> 
      <status>In progress</status> 
      <category>Hardware</category> 
      <subcategory>Damaged Equipments</subcategory> 
      <producttype>Batterie</producttype> 
      <summary>Test</summary> 
      <solution>[WebClient 2010-09-27 10:00]Client is requesting an update</solution> 
      </call_details>
     <ressources>
    <ressource>
      <name>Ressource name #1</name> 
      </ressource>
    <ressource>
      <name>Ressource name #2</name> 
      </ressource>
    
      </ressources>
      </call>
    I've got it all figured out, but the only remaining bit is those ressources I want to show up in the form. Do you have any idea what kind of widget I could use to plug it in there ?

    Thanks!

  2. #2
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    Depends on your needs, but here's some classes you can look at...

    Ext.grid.GridPanel (this one would probably be overkill... )
    Ext.list.ListView
    Ext.DataView

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    119
    Vote Rating
    5
    drunkmoose is on a distinguished road

      0  

    Default


    Thanks alot for your reply! But I'm a little confused as what to provide for the store config. option as I want to use what the form already loaded.

    Here's my form code (nevermind the ASP code, I'm doing dynamics JS):

    http://pastebin.com/zF4mnjfp

  4. #4
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    You can use the 'data' config option to load the resources already fetched from the server into the store.

    Here's an example:

    PHP Code:
    Ext.onReady(function() {
     
      
    //Creating the store passing inline data
      
    var store = new Ext.data.ArrayStore({
       
    idIndex0,
       
    fields: ['name'],
       
    data: [
        [
    'Resource1'],
        [
    'Resource2'],
        [
    'Resource3']
       ]
      });
      
      new 
    Ext.list.ListView({
       
    storestore,
       
    columns: [
        {
         
    header:'Resource',
         
    width1//100%
         
    dataIndex'name'
        
    }
       ],
       
    renderToExt.getBody() //Render to body
      
    });
     }); 

  5. #5
    Sencha User
    Join Date
    Jul 2010
    Posts
    119
    Vote Rating
    5
    drunkmoose is on a distinguished road

      0  

    Default


    Thanks, but the store you are creating does not in no way refer to the XML that's been loaded already for the rest of the form.

    I want to be able to do it another form field like:
    Code:
     
     
    {
      fieldLabel: 'Ressource(s)'
      xtype:     'listview',
      store: XML that's already loaded for the rest of the form,
      columns: [{header: 'Name',dataIndex: 'name' }]
    }
    This is the line of code that loads the data for the form (nevermind the ASP tags):

    Code:
    formPanel.getForm().load({method: 'GET', url:'main_xml.asp?mode=single&id=' + selectedCall, waitTitle:'<%=Session("LOADING_TITLE")%>',waitMsg:'<%=Session("LOADING_MSG")%>'});
    I just don't know how I could syntaxically refer to the data that's currently feeding the form. I know I might be able to pull it off adding something like this in teh code block above:

    Code:
    formPanel.add({fieldLabel: 'Ressource(s)', xtype:'listview', store:formPanel.?????});

  6. #6
    Sencha User
    Join Date
    Aug 2009
    Posts
    480
    Vote Rating
    1
    plalx has a spectacular aura about plalx has a spectacular aura about

      0  

    Default


    To refer to the loaded data, you can listen to the Ext.form.BasicForm 'actioncomplete' event checking up the Action.result property.
    Then you will be able to build the store based on this data.

Similar Threads

  1. how to add a widget in a AsyncCallback Method to a extral widget
    By TOMMYZHANG in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 10 Jul 2011, 9:35 AM
  2. Transfer widget values to model instance - conceptual question
    By TheBerliner in forum Ext 3.x: Help & Discussion
    Replies: 15
    Last Post: 21 Nov 2009, 10:51 PM
  3. Replies: 0
    Last Post: 22 Aug 2009, 1:35 AM

Thread Participants: 1