PDA

View Full Version : How should I get suggest under a textField



Chap
12 Oct 2009, 7:00 PM
Hi all,

I have a textField. I want to get a search suggest just like google search. As so many data to be search, I want to get suggest below the textfield base on my input.

So, below is my code. How should I add the dataView like combobox? I have no idea of the code in success. Please give me a hint! Thanks.



var searchField = new Ext.form.TextField({
emptyText: '',
labelSeparator: '',
listeners: {
render: function(f){
f.el.on('keydown', function(e){
var text = e.target.value;
Ext.Ajax.request({
url: 'searchNumber.php?value='+text
},
success: function (r){
// ???? Here, how should I write the code for a suggest dropdownlist??
},
failure: function (r){

}
});
}, f, { buffer: 350 });}}
});

jarlau
12 Oct 2009, 7:10 PM
use ComboBox (http://www.extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox)with hideTrigger: true conifg instead.