1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    14
    Answers
    1
    Vote Rating
    0
    volcom721 is on a distinguished road

      0  

    Default Unanswered: Combobox always get value of displayField in IE

    Unanswered: Combobox always get value of displayField in IE


    Dear All:
    I has a problem here, i think taht maybe is a bug. I write a combobox function like Ex1.
    The function is work current in FireFox and Chroom, but in IE8 the value of this combobox
    will always get displayField value ( "Read Only" or "Read/Write" ).
    Please some body help me. thanks.


    Code:
    Ex1:
    ...
    	{ header: "Policy", dataIndex:'policy', flex: 1, sortable: true, align:'center',
    		renderer:function(value){
    			return (value.indexOf('ro') > -1 )? 'Read Only':'Read/Write';
    		},
    		editor:{
    			xtype:'combobox',
    			mode: 'local',
    			triggerAction: 'all',
    			forceSelection:true,
    			displayField:'label',
    			valueField:'policy',
    			store:{
    				xtype: 'jsonstore',
    				fields:[ 'label', 'policy' ],
    				data:[
    				  {label: 'Read Only', policy: 'ro'},
    				  {label: 'Read/Write', policy: 'rw'}
    				]
    			}
    		}//eo editor
    	}



    thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,780
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What Ext JS 4 version? Using a combobox as an editor works no issues for me.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    14
    Answers
    1
    Vote Rating
    0
    volcom721 is on a distinguished road

      0  

    Default


    Dear mitchellsimoens:
    Ext version tested:
    Ext 4.1.1

    Browser versions tested against:
    IE 8 (Windows)

    Description:
    Ext.form.field.Combobox - method getValue always get displayfield value.
    The other, i has use a plug-in tool Ext.i18n.Bundle( https://github.com/elmasse/Ext.i18n.Bundle ) to display label information.

    Steps to reproduce the problem:
    Create an form contain a Ext.form.field.Combobox.
    I use a plug-tool "Ext.i18n.Bundle" to set the value of displayfield.
    Select a option of combobox.
    The value return by method "getValue" is displayfield value, not valuefield.


    Test Case:
    Code:
    ...
        { header: "Policy", dataIndex:'policy', flex: 1, sortable: true, align:'center',
            renderer:function(value){
                return (value.indexOf('ro') > -1 )? 
    				Ext.i18n.appBundle.getMsg('Sharev.READY_ONLY'):
    				Ext.i18n.appBundle.getMsg('Sharev.READY_WRITE');
            },
            editor:{
                xtype:'combobox',
                mode: 'local',
                triggerAction: 'all',
                forceSelection:true,
                displayField:'label',
                valueField:'policy',
                store:{
                    xtype: 'jsonstore',
                    fields:[ 'label', 'policy' ],
                    data:[
                      {label: Ext.i18n.appBundle.getMsg('Sharev.READY_ONLY'), policy: 'ro'},
                      {label: Ext.i18n.appBundle.getMsg('Sharev.READY_WRITE'), policy: 'rw'}
                    ]
                }
            }//eo editor
        }



    See this URL for live test case:
    none
    Debugging already done:
    none
    Additional CSS used:
    only default ext-all.css
    Operating System:
    WindowsXP SP3

  4. #4
    Sencha User
    Join Date
    Sep 2012
    Posts
    9
    Answers
    1
    Vote Rating
    1
    Lunti is on a distinguished road

      0  

    Default


    The same question I answered seconds ago:

    Quote Originally Posted by Lunti View Post
    I had troubles with that, too. It's caused by writing in a combobox without selecting an item. In that case the value will be the actual inserted Text. (i. e. when having typos)

    I would use the validation config in the model and make a regular expression comparison like in a numerical value:
    Code:
    var regex = new RegExp('^[0-9]+$');
    if(this.getValue() && this.getValue().match(regex))

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    14
    Answers
    1
    Vote Rating
    0
    volcom721 is on a distinguished road

      0  

    Default


    Dear lunti:
    Sorry, i was review about your post( Combobox in a form posts description instead of value ), but i am so confused about that. Should i put that code you post insert to model? but the code just filter data, right?
    If i want to get the value from 'valuefield' that i need assigent value to 'valuefield' again, or has another why?

    thank you

  6. #6
    Sencha User
    Join Date
    Sep 2012
    Posts
    9
    Answers
    1
    Vote Rating
    1
    Lunti is on a distinguished road

      0  

    Default


    Hey volcom721,

    I don't understand your problem very well. The code i gave is to prevent getting a wrong formatted value.
    You can use it anywhere - if you have problems with validating for example, put it in the model validation.

    In my case I had to validate it on the "select" event before I reload my store.

  7. #7
    Sencha User
    Join Date
    Feb 2012
    Posts
    14
    Answers
    1
    Vote Rating
    0
    volcom721 is on a distinguished road

      0  

    Default


    Ok, i will try again. However, i am so thanks for your help.

Thread Participants: 2

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