View Full Version : search able combobox

11 Mar 2010, 1:43 AM
hi all ,

am working on search-able combobox

but i'm getting the following error "invalid label"

the source is


var ds = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({
url: 'districtProxy.php'
reader: new Ext.data.JsonReader({
root: 'district',
totalProperty: 'totalCount'
}, [
{name: 'DIST_E'}

// Custom rendering Template
var resultTpl = new Ext.XTemplate(
'<tpl for="."><div class="search-item">',

var search = new Ext.form.ComboBox({
store: ds,
typeAhead: false,
loadingText: 'Searching...',
width: 570,
tpl: resultTpl,
applyTo: 'search',
itemSelector: 'div.search-item',
onSelect: function(record){ // override default onSelect to do redirect
// window.location =
// String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);

server side

$districts = array();
$districtRec = array();

$sql = "SELECT * FROM district WHERE DIST_E LIKE '%".$_GET['query']."%'";
$result = mcq($sql,$db);
while($rec = mysql_fetch_array($result)){
$districtRec['DIST_E'] = $rec['DIST_E'] ;

$districts[] = $districtRec ;

$JsonArr = array ('totalCount'=>count($districts),'district'=>$districts);
echo json_encode($JsonArr) ;

where is the problem please ?

11 Mar 2010, 2:45 AM
anybody can help ?

11 Mar 2010, 3:03 AM
You waited a full hour ;)

Why are you using ScriptTagProxy? See the docs (http://www.extjs.com/deploy/dev/docs/?class=Ext.data.ScriptTagProxy) for what it expects back from your server:

The content passed back from a server resource requested by a ScriptTagProxy must be executable JavaScript source code because it is used as the source inside a <script> tag.

Try it with HttpProxy. Also, add load and exception handlers to your store to ensure it it loading your data (or if not, why!)