Results 1 to 4 of 4

Thread: why combox can't show displayfield on editorgrid

  1. #1

    Default why combox can't show displayfield on editorgrid


    help me,thanks

    When I get focus in cell,it will show displayfield value '业务一部', lost focus it will show value field '003',
    I want to get and lost always show displayfield value '业务一部'.
    (2)But when i update data,I will use value field as hidden value. display field only show.

  2. #2
    Sencha User catacaustic's Avatar
    Join Date
    Jul 2007
    "A Land Down Under"


    ComboBox editors in EditorGridPanels return the valueField value to the cell, not the displayField. That's the biggest problem with ComboBox's in EditorGridPanels that there is so far, and the only answer to it is to use a custom renderer with that column that can get the displayField value from the data store that is attached to the ComboBox. It's a bit of a long-way-around trip to get what should be easy, but this is one of those things that doesn't seem to have had to much thought put into it by the developers so far unfortunately.
    'Once again, fortune vomits on my eiderdown'
    - Edmund Blackadder

  3. #3


    Its a bit of coding, but is easy to understand

    //Combo Renderer
    comboRenderer= function(value) {
    	var record =;
    	return record ? record.get('text') : '';
    //Combo Definition
    var yourComboName= new Ext.form.ComboBox({
    	typeAhead: true,
    	triggerAction: 'all',
    	listClass: 'x-combo-list-small',					
    	displayField: 'text',
    	valueField: 'value',
            id: 'value'
    //Combo Column
    var comboColumn = {
    	header: 'yourHeader',
    	dataIndex: 'yourDataIndex',
    	width: 150,	
    	renderer: comboRenderer,
    	editor: yourComboName

  4. #4

    Thumbs up

    Ha! I had exactly the same question. Thank you!

Posting Permissions

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