Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    May 2007
    Posts
    25
    Vote Rating
    0
    rswafford is on a distinguished road

      0  

    Default Set ComboBox selected value from form.load()

    Set ComboBox selected value from form.load()


    I've got a form inside a LayoutDialog. This form loads its data dynamically when a row in a grid is double clicked. Most of it works great, but one field, a ComboBox, does not select its appropriate value automatically.

    The ComboBox also loads its values dynamically via JSON. What do I need to do to select the appropriate value in the ComboBox when the form loads data?

    Code:
            var companies = new Ext.data.Store({
                proxy: new Ext.data.HttpProxy({
                    url: 'companies.php?Action=Get'
                }),
                reader: new Ext.data.JsonReader({
                    root: 'companies'
                },['company_id', 'company_name'])
            });
            
            companies.load();
            
            var cmpCombo = new Ext.form.ComboBox({
                fieldLabel: 'Company',
                store: companies,
                displayField: 'company_name',
                typeAhead: true,
                valueField: 'company_id',
                emptyText: 'Select company...'
            });
            
            var frm = new Ext.form.Form({
                labelAlign: 'left',
                labelWidth: 125,
                waitMsgTarget: 'project-info',
                reader: new Ext.data.JsonReader({
                    root: 'project', totalProperty: 'totalCount'
                }, [
                    {name: 'project_name', mapping: 'project_name', type: 'string'},
                    {name: 'project_description', mapping: 'project_description', type: 'string'},
                    {name: 'company_id', mapping: 'company_id', type: 'string'}
                ])
            });
            
            frm.fieldset(
            {legend:'Project Information'},
            new Ext.form.TextField({
                fieldLabel: 'Project Name',
                name: 'project_name',
                width:190
            }),
            new Ext.form.TextArea({
                fieldLabel: 'Description',
                name: 'project_description',
                width: 400,
                height: 150
            }),
            cmpCombo
          );
            frm.render('project-info-form');
            cmpCombo.render();
            
            return frm;

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,506
    Vote Rating
    373
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Have you tried combo.setValue(...) method?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  3. #3
    Ext User
    Join Date
    May 2007
    Posts
    25
    Vote Rating
    0
    rswafford is on a distinguished road

      0  

    Default


    Figured it out...I didn't specify the right name for the combo box in its config section. I set that properly and it works now. What I get for coding at 11:30 at night...

  4. #4
    Ext User jonak's Avatar
    Join Date
    Apr 2009
    Posts
    2
    Vote Rating
    0
    jonak is on a distinguished road

      0  

    Default I have the same problem

    I have the same problem


    rswafford:
    I have the same problem and I see in the post that you have the solution but I did not understand it at all. Could you please put the complete code here. Thanks

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Location
    France
    Posts
    3
    Vote Rating
    1
    tleperou is on a distinguished road

      0  

    Default Complete code could be great

    Complete code could be great


    Hi, thx for your help about combobox loading data,

    but I'm in the same case, and the complete code could be helpfull
    in addition to your short explains.

    now, no matter

  6. #6
    Sencha User mkariti's Avatar
    Join Date
    Aug 2011
    Posts
    92
    Vote Rating
    0
    mkariti is on a distinguished road

      0  

    Default


    http://docs.sencha.com/ext-js/4-0/#!...ethod-setValue
    This works fine for me.
    Code:
    EditPartnerProfileForm.getForm().setValues({
                             Name : strtojson.displayname,
                              url : strtojson.url,
                              country : strtojson.country
                          });
    The "Name" and "url" are my textfields names. the country is the combo box name. Please note that in order to display a new value in the combo box you must send a value that exists in the combo box and only then it will be able to show the responded value.

    setValue( String/String[] value ) : Ext.form.field.FieldSets the specified value(s) into the field. For each value, if a record is found in the store that matches based on the valueField, then that record's displayField will be displayed in the field. If no match is found, and the valueNotFoundText config option is defined, then that will be displayed as the default field text. Otherwise a blank value will be shown, although the value will still be set.