PDA

View Full Version : Uncaught Type Error for ItemSelector



sencha.santa
2 Apr 2014, 1:48 AM
Hi ,

I'm getting Uncaught TypeError: Cannot call method 'substring' of undefined for the below code.
Please help me.

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);
}
});
}
}
}],

});

scottmartin
2 Apr 2014, 11:58 AM
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?


Ext.Loader.setPath('Ext.ux', '../../extjs4/examples/ux');