View Full Version : Store option add=true + ComboBox problem

9 Nov 2010, 8:19 AM
I'm using a ComboBox to query to a URL that returns JSON data to be read by Store+JsonReader.

By default, Store replaces the data in its cache every new query. However, i want Store to append the data on every new query. Fortunately, Store.load() does take an option parameter 'add: true' to append the data so that it accumulates data every query.

However, the option causes an error after the first query. (look on the 'beforeload' event listener)

var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '/customer/list'

reader: new Ext.data.JsonReader({
root: 'data',
totalProperty: 'total',
id: 'customerId',
fields: [
{name: 'customerName', mapping: 'customerName'},
{name: 'city', mapping: 'city' }

baseParams: {
limit: 25,
sort: '',
start: 0,
status: ''

listeners: {
'beforeload': function(store, options){
options = Ext.apply(options, { add: true }); // this causes an error!

var combo = new Ext.form.ComboBox({
allowBlank: false,
applyTo: elem_id,
displayField: 'customerName',
hideTrigger: true,
listeners: {
scope: this,
'beforequery': function(qe) {

if (qe.query.length > 0) {
var newQuery = this.customerSearch.createLINQ(qe.query);
qe.query = newQuery;
else {
qe.cancel = true;
loadingText: 'Searching...',
store: ds,
typeAhead: false,
width: 500

When i examine the store object (via combo.store.data in firebug) after the error, the data accumulates, so it does in fact work.

The error is actually in the interaction with the ComboBox where it's throwing an error in its inserSibling method when building out the DOM for the new combo list. it ONLY happens when the add option is enabled.

If anyone has experienced this problem before and has a workaround, please let me know. thanks!