PDA

View Full Version : Why is the ComboBox queryParam NOT sent to the server?



edykstra
23 Sep 2010, 8:36 PM
For some reason, when the store sends a request to the server, the queryParam name and value are NOT sent as a parameter.

In FireBug, I see all the baseParams listed, with proper expected values, including the unique 'nada' parameter I am sending simply to make sure the http request I see in Firebug, is indeed from this code segment.

However, the 'search[daily_file_record_owner_begins_with]' parameter is NOT sent to the server. Why?

Thanks in advance for your help.



this.companyComboBox = new Ext.form.ComboBox({
allowBlank: true,
anchor: '-20',
displayField: 'company',
editable: true,
fieldLabel: 'Company Name',
forceSelection: false,
id: this.prefixID + 'company',
listeners: {
'beforequery': this.check_lookup_status,
'select': this.fetchLead,
scope: this
},
maxHeight: 200,
minChars: 1,
minListWidth: 220,
mode: 'remote',
pageSize: 25,
queryParam: 'search[daily_file_record_owner_begins_with]',
resizable: true,
store: new LeadStore({
autoLoad: false,
baseParams: {
authenticity_token:window._token,
format: 'json',
limit: 200,
nada: 0,
start: 0,
totalProperty: 'totalCount',
'search[order]': 'ascend_by_company' //'ascend_by_owner'
},
url: '/mailing_records'
}),
tabIndex: 4,
tpl: '<tpl for="."><div ext:qtip="{_last_name}, {_first_name}<br>{city}, {state}<br>{mail_piece}" class="x-combo-list-item">{company}</div></tpl>',
triggerAction: 'query',
valueField: 'id',
width: 550
});

Animal
23 Sep 2010, 9:20 PM
Are you sure? Post the packet contents as copied from Firebug. This works for everyone else.

edykstra
23 Sep 2010, 9:34 PM
Animal,

Not sure what you mean by 'packet contents'.

In the Firebug console, the http request has the following parameters:

dc 1285306297348
authenticity_token ykVyHVM6z0hifVb3sfzGZGruyHVCMCuadHtki0qQkxA=
format json
limit 200
nada 0
search[order] ascend_by_company
start 0
totalProperty totalCount

Animal
23 Sep 2010, 11:59 PM
I just pasted this into my Firebug console



Ext.getBody().update('')
new Ext.form.ComboBox({
allowBlank: true,
displayField: 'company',
editable: true,
fieldLabel: 'Company Name',
forceSelection: false,
maxHeight: 200,
minChars: 1,
minListWidth: 220,
mode: 'remote',
pageSize: 25,
queryParam: 'search[daily_file_record_owner_begins_with]',
resizable: true,
store: new Ext.data.Store({
reader: new Ext.data.ArrayReader({}, Ext.data.Record.create(['company'])),
autoLoad: false,
baseParams: {
authenticity_token:window._token,
format: 'json',
limit: 200,
nada: 0,
start: 0,
totalProperty: 'totalCount',
'search[order]': 'ascend_by_company' //'ascend_by_owner'
},
url: '/mailing_records'
}),
tabIndex: 4,
tpl: '<tpl for="."><div ext:qtip="{_last_name}, {_first_name}<br>{city}, {state}<br>{mail_piece}" class="x-combo-list-item">{company}</div></tpl>',
triggerAction: 'query',
valueField: 'id',
width: 550,
renderTo: document.body
});


And typed "pook" into the rendered ComboBox.

And this got POSTed:



authenticity_token
format json
limit 25
nada 0
search[daily_file_record_... pook
search[order] ascend_by_company
start 0
totalProperty totalCount


Source of the POST body:



start=0&limit=25&authenticity_token=&format=json&nada=0&totalProperty=totalCount&search%5Border%5D=ascend_by_company&search%5Bdaily_file_record_owner_begins_with%5D=pook


So you broke something and need to step through the Store's loading method where it builds its params. Try a breakpoint in your beforequery handler and step through examining parameters at each step.

armandoxxx
1 Mar 2012, 1:24 AM
Hey ..

looking at this at the moment .. and here's what's not working ...

you entered "some text" text you get results from store, you select a record, you press a trigger, store reloads with all necessary parameters but without values.

Request parameters when typing:



Query String Parametersview URL encoded
_dc:1330593592365
searchStr:Delo
country:
language:en



Request parameters when clicking on trigger



Query String Parametersview URL encoded
_dc:1330593594439
searchStr:
country:
language:en


check searchStr vlaue ...

combo with store config


Object
allowBlank: false
anchor: "95%"
displayField: "name"
fieldLabel: "Media"
hiddenName: "media"
id: "article-editing-filter-field-media"
lazyRender: true
minChars: 2
mode: "remote"
queryParam: "searchStr"
store: Ext.data.Store.Ext.extend.constructor
autoLoad: false
baseParams: Object
batchCounter: 0
batches: Object
data: Ext.util.MixedCollection
events: Object
fields: Ext.util.MixedCollection
modified: Array[0]
paramNames: Object
proxy: Ext.data.HttpProxy
reader: Ext.data.JsonReader
recordType: function (){I.apply(this,arguments)}
removed: Array[0]
sortToggle: Object
storeId: "article-editing-filter-field-media-store"

tabIndex: 10
triggerAction: "all"
typeAhead: true
valueField: "id"


Any help would be appreciated .. using 3.4

Regards

Armando