Results 1 to 2 of 2

Thread: RowSelectionModel Problem

  1. #1
    Sencha User
    Join Date
    Mar 2008
    Posts
    47

    Default RowSelectionModel Problem

    I have a grid and a form, on the same page

    when I select a row on the grid it displays the info in the form. I have drop down lists in my form, those get their data from an ajax query to the server which return json data(these work fine).

    How do I select a row in these combo box... because when I save the data to the server, it sends the displayField instead of the valueField .. and if I use hiddenName it sends the value but doesn't show the displayField on the screen (on RowSelect). If I select a row in the combo box manually it sends the valueField to the server and I can see the displayField..

    here's the code:

    the grid.RowSelectionModel
    PHP Code:
    sm: new Ext.grid.RowSelectionModel
                
    ({
                    
    singleSelecttrue,
                    
    listeners: {
                        
    rowselect: function(smrowrec) {
                            
    // form content
                            
    Ext.getCmp("frmCandidate").getForm().loadRecord(rec);
                        }
                    }
                }), 
    the combo
    PHP Code:
    .... form stuff up here
    ...........
    {   
    xtype:'combo',
         
    fieldLabel'Country',
         
    name'countryID',
         
    autoHeight:true,
         
    anchor:'95%' ,
         
    storeDropDownLists.Countries,
         
    valueField:'countryID',
         
    displayField:'countryName_EN'
         
    hiddenName:'countryName_EN',
         
    typeAhead:true,
         
    mode:'local',
         
    triggerAction:'all',
         
    forceSelection:true
    }, 
    ......... 
    DropDownLists.Countries returns something like this
    PHP Code:
    {"countryID":"38","countryName_EN":"Canada"
    countryID is also in the grid's store, countryName_EN is not
    thank you

  2. #2
    Sencha User
    Join Date
    Mar 2008
    Posts
    47

    Default

    I managed to make it work!

    If anybody ever enconter the same problem, just add an id attribute to your combo

Posting Permissions

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