1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    27
    Vote Rating
    0
    genggeng13 is on a distinguished road

      0  

    Default How display combobox displayValue in RowEditing

    How display combobox displayValue in RowEditing


    Hi guy,

    i am using the plugin roweditor for my grid , my grid are able to show the displayField , but when i click to activate the roweditor , it will show the valueField in the editor combo box .

    May i know how to show the displayField as well in the row editor combo box

    here is my column code :

    Code:
    { header: 'ClaimType', dataIndex: 'ClaimType', field: {        
                           xtype: 'combobox',
                            queryMode: 'local',
                            store: stType,
                            displayField: 'text',
                            valueField: 'value',
                            lazyRender: true
                        }, renderer: rdrClaimType},
    My rendere is like this

    Code:
    function rdrClaimType(val) {     
       if(val == 1 ){
            return 'Travel';
        }
        else if(val == 2 ) {
            return 'Parking';
        }
       
        else if(val == 3 ) {
            return 'Refreshment';
        }
        else if (val == 4) {
            return 'Others';
        }
    }
    thank you

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

  3. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Here is a small example .. is displays the name in the combo:

    Code:
    var store = Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['id', 'name', 'email', 'change'],
        data:{'items':[
            { 'id': 1, 'name': 'Lisa',  "email":"lisa@simpsons.com",  "change":100  },
            { 'id': 2, 'name': 'Bart', "email":"bart@simpsons.com", "change":-20  },
            { 'id': 3, 'name': 'Homer', "email":"home@simpsons.com",  "change":23   },
            { 'id': 4, 'name': 'Marge', "email":"marge@simpsons.com", "change":-11   }
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
        clicksToMoveEditor: 1,
        autoCancel: false
    });
    
    var rowRenderer = function(val) {
        var myNames=['Lisa','Bart','Homer','Marge']; // dummy array from store data 
        return myNames[val-1]; // 0 based
    };    
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            { header: 'Combo', dataIndex: 'id', renderer: rowRenderer, editor:
            {
                xtype: 'combobox',
                store: store,
                queryMode: 'local',
                displayField: 'name',
                valueField: 'id'
            } 
            },
            { header: 'Name',  dataIndex: 'name' },
            { header: 'Email', dataIndex: 'email', flex: 1 },
            { header: 'Change', dataIndex: 'change' }
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody(),
        plugins: [ rowEditing ]
    });
    Scott.

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    27
    Vote Rating
    0
    genggeng13 is on a distinguished road

      0  

    Default


    Thank you scott

    i try with your example.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi