I am creating a combo box using extjs 4 in an editable grid (im using extjs 4) and i am using external ajax call to populate it rather than using a extjs proxy, the reason is that i am using the same call for loading other combo boxes. So i thought why not use the same function. Here is the code for store, model, dropdown and ajax call:
var drpdwnitems = "";
Ext.define('rStatusRecord', {
extend: 'Ext.data.Model',
fields: [
{ name: 'code', type: 'string' },
{ name: 'value', type: 'string' }
]
});
var dsStatus = Ext.create('Ext.data.Store', { model: 'rStatusRecord', data: [] });
var timeSelectField_1 = {
xtype: 'combobox',
typeAhead: true,
displayField: 'code',
valueField: 'value',
store: dsStatus,
triggerAction: 'all'
};
This field is basically used in grid panel’s column for the editing purpose. AJax call is basically returning a string.
$.ajax({
type: "GET",
url: "XHR/Task_TypesCalls.aspx?TL_A=1",
error: function() { alert('Error loading document'); },
success: loadAvailableTasksList
});
function loadAvailableTasksList(contents, status) {
drpdwnitems = contents.split("!");
if (status != "success") return;
var drpdwnitemsind;
dsStatus.removeAll();
for (i = 0; i < drpdwnitems.length; i++) {
drpdwnitemsind = drpdwnitems[i].split(":");
statusRecord = Ext.create('rStatusRecord', {
code: drpdwnitemsind[0], //"",
value: drpdwnitemsind[0]//""
});
dsStatus.add(statusRecord);
} //end of loop
}
Now when i edit the field and open the combo box, there is an error
TypeError: url is undefined
This error is in the file ext-all-debug.js
What my guess is that url config of store is necessary and im not providing it. OR am i doing something wrong here?
See: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.ComboBox-cfg-queryMode
You want to set it to local.