1. #1
    Ext User
    Join Date
    Jun 2007
    Posts
    1
    Vote Rating
    0
    giovabal is on a distinguished road

      0  

    Question value instead of text in Combobox after selection

    value instead of text in Combobox after selection


    I have a Combobox, it uses a json store sending (id,name) couples for populating value and text
    when you click on the combo it shows all the right options (ie: store loads the right way)
    you select an option, still everything ok, showing the selected item text
    when combobox blurs it shows selected item value, not the text!

    it worth mentioning that this combobox lives in an editorgrid

    PHP Code:
    Ext.onReady(function() {
      var 
    conn     = new Ext.data.Connection({});

      var 
    listReader = new Ext.data.JsonReader({
        
    totalProperty'count',
        
    root         'items',
      }, [{
    name'id'}, {name'name'}]);

      var 
    famigliaStore = new Ext.data.Store({
        
    proxy : new Ext.data.HttpProxy({url'/load_list/Famiglia/'   method'GET'}),
        
    readerlistReader,
      });
        
      var 
    famcombo = new Ext.form.ComboBox({
        
    fieldname    'Famiglia',
        
    store        famigliaStore,
        
    typeAhead    true,
        
    triggerAction'all',
        
    lazyRender   true,
        
    setEditable  false,
        
    selectOnFocustrue,
        
    emptyText    'Famiglia...',
        
    displayField 'name',
        
    valueField   'id',
        
    hiddenName   'famiglia',
        
    autoLoad     true,
      });

      var 
    cm = new Ext.grid.ColumnModel([
      {
        
    header   "Famiglia",
        
    dataIndex'famiglia',
        
    width    130,
        
    editor   : new Ext.grid.GridEditor(famcombo),
      }]);

      
    cm.defaultSortable false;

      var 
    ds = new Ext.data.Store({
        
    proxy : new Ext.data.HttpProxy({url'/loadlist/'method'GET'}),
        
    reader: new Ext.data.JsonReader({
          
    totalProperty'count',
          
    root         'items',
          
    id'id',
        }, new 
    Ext.data.Record.create([{name'famiglia'}]))
      });

      var 
    grid = new Ext.grid.EditorGrid('editor-grid', {
        
    ds              ds,
        
    cm              cm,
        
    enableColumnMovefalse,
        
    enableCtxMenu   false,
        
    clicksToEdit    2,
        
    trackMouseOver  true,
     });



      var 
    layout Ext.BorderLayout.create({
        
    center: {
          
    panels: [new Ext.GridPanel(grid)]
        }
      }, 
    'grid-panel');


      
    grid.render();
        
    ds.reload();

    }); 
    any help?
    thank you

  2. #2
    Ext User 0xception's Avatar
    Join Date
    Apr 2007
    Posts
    33
    Vote Rating
    0
    0xception is on a distinguished road

      0  

    Default


    I've run into the same problem. When you use a gridEditor with a ComboBox that has a displayField and a valueField the value field is displayed once a selection is made. I've attached a screenshot to show what it looks like. I'm sure there's a way to hack around it by catching events and going to change the raw value/display text of the grid, but it seems like this isn't the intended purpose.

    Not sure if you call this a bug or not, but maybe there's something we're missing... Anyone has any ideas how to fix this?

    EDIT: ... oops i didn't see that this was in the Ext-1.1 forum... i'm using 2.1, it seems from other threads the best/current method is to just create a render function for the column and build cell's rendered text from the value.
    Attached Images
    Last edited by 0xception; 1 May 2008 at 3:46 PM. Reason: Wrong thread

  3. #3

Thread Participants: 2

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