Results 1 to 2 of 2

Thread: getValue() Probem..

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Jakarta - Indonesia
    Posts
    169

    Question getValue() Probem..

    Hi All..

    I have a form that contain some comboboxes and a textfield.
    When I want to save data from those components, there is an error like this "item.getValue is not a function" .
    But if I use Ext.getCmp('id').getValue() on each component, the data can be saved.

    Here is my code :
    For my save button
    Code:
    buttons:[
                {
                    text: 'Save',
                    iconCls:'icon-disk ',
                    listeners:
                    {
                        click:
                        {
                            scope: this,
                            fn: saveVIMS_comp_group
                        }
                    }
                }
    For saveVIMS_comp_group function
    Code:
    function saveVIMS_comp_group()
    {
    if(this.getForm().isValid() && this.getForm().findField().getValue())
                {
                    Ext.Ajax.request
                    ({
                        url: newhid.core.vims_comp_group.controller +'/save',
                        params: //{
                            // 'idsite': Ext.getCmp('siteCombo').getValue(),
                            // 'idfleet': Ext.getCmp('fleetCombo').getValue(),
                            // 'idprefix': Ext.getCmp('prefixCombo').getValue(),
                            // 'component_code': Ext.getCmp('compCombo').getValue(),
                            // 'idmodifier': Ext.getCmp('modifierCombo').getValue(),
                            // 'order_index': Ext.getCmp('order_index').getValue(),
                            // 'comp_id': Ext.getCmp('comp_id').getValue(),
                            // 'action': Ext.getCmp('action').getValue()
                        // },
                        this.getFormValues(),
                        scope: this,
                        callback: function(options, success, response){
                            var respon = response.responseText;
                           
                            if(respon == '1'){
                                Ext.getCmp('vims_comp_group_grid').getStore().reload();
                                Ext.MessageBox.alert('Status','Data Has Been Saved..');
                            }
                            else if(respon == '1062'){
                                Ext.MessageBox.alert('Status','Your data can not be saved, Data Duplicated..');
                            }
                            else if(respon == '0'){
                                Ext.MessageBox.alert('Status','Data not found..');
                            }
                            else{
                                Ext.MessageBox.alert('Saving Data Failed..',response.responseText);
                            }
                        }
                    });   
                }
            }
    For getFormValues
    Code:
    getFormValues: function()
        {
            var retVal = {};
            this.items.each(function(item) {
                retVal[item.name] = item.getValue();
            });
            return retVal;
        }
    Could someone help me on this please?

    Thanks..
    Berusaha dan Berdoa

  2. #2
    Sencha User
    Join Date
    Nov 2009
    Posts
    61

    Default

    Hi yagi,

    Try this

    Code:
    getFormValues: function()
        {
            var retVal = {};
            this.items.items.each(function(item) {
                retVal[item.name] = item.getValue();
            });
            return retVal;
        }

Similar Threads

  1. RadioGroup GetValue
    By maquejp in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 21 Dec 2009, 6:59 AM
  2. GetValue problem
    By boyan.dimitrov in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 6 Dec 2009, 4:49 AM
  3. Getvalue combobox
    By Sandrine in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 13 May 2009, 9:15 AM

Posting Permissions

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