Results 1 to 2 of 2

Thread: Uncaught Type Error for ItemSelector

  1. #1

    Default Uncaught Type Error for ItemSelector

    Hi ,

    I'm getting Uncaught TypeError: Cannot call method 'substring' of undefined for the below code.
    Please help me.
    Code:
    Ext.require( ['Ext.data.*', 'Ext.window.Window', 'Ext.chart.*', 'Ext.grid.*', 'Ext.ux.grid.FiltersFeature', 'Ext.tab.*','Ext.form.Panel',    'Ext.ux.form.MultiSelect',
        'Ext.ux.form.ItemSelector']);
    Ext.define('multiselectmodel', {
        extend: 'Ext.data.Model',
       fields: ['RWLOGIN_ID','RWEMP_Name','RWEMP_Num']
    });
    
    
    var multiselectstore = Ext.create('Ext.data.Store',{ //Reviewer Name Combo box store
        model: 'multiselectmodel',
        autoLoad: false,
    	autoSync: true,
        proxy: {
            type: 'ajax',
            url : 'reviewernamecombo.asp',
            reader: {
                type: 'json',
                root: 'reviewername'
            }
        }
    });
    var multiselect=Ext.create('Ext.form.Panel', {
        bodyPadding: 5,
        width: 700,
    	header:false,
        // The form will submit an AJAX request to this URL when submitted
        url: 'save-form.php',
    
    
        // Fields will be arranged vertically, stretched to full width
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },
    
    
        // The fields
         items:[{
                xtype: 'itemselector',
                name: 'itemselector',
                anchor: '100%',
                fieldLabel: 'ItemSelector',
                imagePath: '../images/icons/fam/error.gif',
    
    
                store: multiselectstore,
                displayField: 'RWEMP_Name',
                valueField: 'RWEMP_Name',
                
    
    
                allowBlank: false,
                // minSelections: 2,
                // maxSelections: 3,
                msgTarget: 'side'
            }],
    
    
        // Reset and Submit buttons
        buttons: [{
            text: 'Reset',
            handler: function() {
                this.up('form').getForm().reset();
            }
        }, {
            text: 'Submit',
            formBind: true, //only enabled once the form is valid
            disabled: true,
            handler: function() {
                var form = this.up('form').getForm();
                if (form.isValid()) {
                    form.submit({
                        success: function(form, action) {
                           Ext.Msg.alert('Success', action.result.msg);
                        },
                        failure: function(form, action) {
                            Ext.Msg.alert('Failed', action.result.msg);
                        }
                    });
                }
            }
        }],
       
    });

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    This error usually means you are trying to use an invalid type (xtype, etc).

    Do you have a loader setup to find your UX path?
    Code:
    Ext.Loader.setPath('Ext.ux', '../../extjs4/examples/ux');

Tags for this Thread

Posting Permissions

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