Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Andrey on Oct 13, 2008 16:55
open dhtmlx forum
Combo list is not filtered in filtering mode

Hi!

can you help with following?

I am trying to use combo in filtering mode with remote data access.

<select style='width:200px;' id="combo_zone1" name="alfa1">
</select>

<script>
var z=dhtmlXComboFromSelect("combo_zone1");
z.enableFilteringMode(true,"<?php echo JURI::Base().'components/com_review-salary_form/'; ?>complete.php");
//z.enableFilteringMode(true,"http://dhtmlx.com/docs/products/dhtmlxCombo/xml/countries/complete.php");
</script>

So on start typing drop-down list is opened with ALL data and it does not filtered when I type other letters both in IE6 and in FF 2 (but autocomplete works). If I change source on yours complete.php (it is commented now) then filtering works fine in IE but nether filtering nor autocmplete works in FF2.

My complete.php

<?php
header("Content-type:text/xml");
?>
<?xml version="1.0" encoding="utf-8"?>
<complete>
<option value=""></option>
<option value="Afghanistan ">Afghanistan </option>
<option value="Albania ">Albania </option>
<option value="Algeria ">Algeria </option>
<option value="Andorra ">Andorra </option>
<option value="Angola ">Angola </option>
<option value="Antigua and Barbuda ">Antigua and Barbuda </option>
<option value="Argentina ">Argentina </option>
<option value="Armenia ">Armenia </option>
<option value="Australia ">Australia </option>
<option value="Austria ">Austria </option>
<option value="Azerbaijan ">Azerbaijan </option>
<option value="Bahamas ">Bahamas </option>
<option value="Bahrain ">Bahrain </option>
<option value="Bangladesh ">Bangladesh </option>
<option value="Barbados ">Barbados </option>
<option value="Belarus ">Belarus </option>
<option value="Belgium ">Belgium </option>
<option value="Belize ">Belize </option>
<option value="Benin ">Benin </option>
</complete>

Thank you!
Answer posted by Support on Oct 14, 2008 01:46
The init of combo , which you are using, cause it works in server side filtering mode, which means , that each time after group of chars typed - it call the server side script and show all response.
If you returning data , which doesn't match mask - it still will be shown on client side.

If you need to load the data once, and filter it on client side after that you can use 
var z=dhtmlXComboFromSelect("combo_zone1"); 
z.enableFilteringMode(true);
z.loadXML("<?php echo JURI::Base().'components/com_review-salary_form/'; ?>complete.php");

>>hen filtering works fine in IE but nether filtering nor autocmplete works in FF2.
Most probably error caused by incorrect XML received from server side. In case of FF - please be sure that there is no any extra ouput before <?xml declaration ( or just remove <?xml line )