UPDATE 18/01/2010
Fixed regression where disabling the component didn't properly disable the items.
New version attached to the first post here
Printable View
UPDATE 18/01/2010
Fixed regression where disabling the component didn't properly disable the items.
New version attached to the first post here
When using this wonderful widget in Ext3.1 and using a DirectStore , the qryvalues parameter gets missing. I had this problem in other cases and its because you no longer can change the baseParameters in a beforeQuery event. BaseParams are ment to be the same all along the lifetime of the store. I made a quick fix for this and that works for me. (in red)Code:doQuery : function(q, forceAll,valuesQuery, forcedAdd){
q = Ext.isEmpty(q) ? '' : q;
var qe = {
query: q,
forceAll: forceAll,
combo: this,
cancel:false
};
if(this.fireEvent('beforequery', qe)===false || qe.cancel){
return false;
}
q = qe.query;
forceAll = qe.forceAll;
if(forceAll === true || (q.length >= this.minChars)){
if(this.lastQuery !== q || forcedAdd){
this.lastQuery = q;
if(this.mode == 'local'){
this.selectedIndex = -1;
if(forceAll){
this.store.clearFilter();
}else{
this.store.filter(this.displayField, q);
}
this.onLoad();
}else{
this.store.baseParams[this.queryParam] = q;
this.store.baseParams[this.queryValuesIndicator] = valuesQuery;
if (typeof valuesQuery == 'undefined'){
valuesQuery=false
}
this.store.load({
//params: this.getParams(q)
params:{
query:q,
qryvalues:valuesQuery
}
});
if(!forcedAdd){
this.expand();
}
}
}else{
this.selectedIndex = -1;
this.onLoad();
}
}
}
});
I was also wondering if there is anyway to limit the choices . In some cases i really just want the user to be able to select ONE value from the dropdown, and this should overwrite the previously selected value , displaying only one box. In other cases it might be useful to limit the values to a number (say 25) , just to stop some users from selecting any option because the are...well...users... :)
again.. Lovely implementation ...great work.
I haven't touched that code since in the previous releases - it was fixed on 15/01/2009 http://www.extjs.com/forum/showthrea...545#post427545
Frederic, Thanks for the report - I don't have a testcase for a direct store so this isn't something I've come accross.
When I have some time, I'll setup a test case and make compatible with Direct.
This has been requested previously and I'll consider adding it to a future release.
No idea why it didn't work the first time. :-?
@limit for the number of choices:
Because I use it as complete replacement for all comboboxes, because I need the valuesQuery ability for edit forms, I'd need a possibility to limit the number to one too.
If I can help let me know.
While looking for possible fixes for my problems I've found some code pieces which I'd like to rewrite a bit.
Should I post diffs or the whole patched file?
No problems, just things like using switch/case instead of repeated if's to make the code nicer.
In fact I stumbled over a glitch I've already discovered some time ago.
The order of the valuesQuery reply isn't kept, so sorting on the server is useless at the moment.
It seems the entries are sorted on the client.
You can test this with a valuesQuery that returns a json of:
The entries will be A,B,C instead of C,B,A.Code:[["1", "C"],["2", "B"],["3", "A"]]
Hi danh2000,
This is a superb extension! Just replaced a few fields with your extension, and I could successfully integrate it with my backend. I am using this as a remote combo box.
Heres all that I have done.
1) Could create remote store fields and load the store
2) Submit values selected to the server
3) Load values into the field for a record retrieved from the backend.
I have one small problem, maybe this is already addressed in the thread, but I could not really find a solution yet... How do I retrieve the value of the posted field values in the backend?? I use a servlet to capture the data, like for a combobox and my field should have also been posted.
I thought we needed the hiddenName parameter, added it and tried accessing it but found it to be null. then tried the name parameter, but that is also null.
Finally I had to pass the values as a string array from the front end via querystringparams.
For this I accessed the field using Ext.getCmp('id').getValue, and I posted the values into the server.. I would like to avoid manually pushing these values like mentioned above, Is this possible?
I am hesitant using getCmp('id') method, becasue I use a tab panel, where users can open multiple records of the same form type and I will have to do ID management of the fields.
Can I avoid this? .
My config is as below.
Once again, thanks for the extension!Code:var recipientsField = new Ext.ux.form.SuperBoxSelect({
allowBlank : false,
id : 'ID_Recipients', // we have to bring a counter
// here..maybe, let me check
// xtype : 'superboxselect',
fieldLabel : 'Recipients',
resizable : true,
minChars : 2,
name : 'EmailIDTX',
anchor : '100%',
store : recipientsStore,
pageSize : 50,
mode : 'remote',
displayField : 'fullname',
displayFieldTpl : '{fullname} ({id})',
valueField : 'id',
queryDelay : 0,
triggerAction : 'all'
//forceFormValue: true
})
Please advise me a better approach if any.
- Sudhir