views:

585

answers:

1

Hi,

I'm developing a form using the Zend Framework and utilising dojo. One part of the form is gathering a users contact details and address. The issue I am hitting is using the FilteringSelect or ComboBox dojo component to select the city/town. I have in my database a list of 40K+ town/city names.

I've tried to use the Dojo component to grab this list but fear that 40K town names is just too big. I don't want to manually use a standard html component as I am sure that all that extra text in the page would make my form a nightmare to load.

So I suppose my question is in 2 parts:

  1. What's the maximum JSON data size I can realistically expect to use, as I expect that what I am using is too big.
  2. What would be the best way of allowing users to select one of these town names in the form?

Thanks in advance.

A: 

Youch, that's a big list of data points. I'd say it's really dependent on the user's browsers and settings. And tolerance for waiting.

If you are able, I'd say to put the data behind a web service and use the the dojox.data.QueryReadStore. That page even has an example of using a service to query states using a ComboBox.

<script>
  dojo.require("dojox.data.QueryReadStore");
  dojo.require("dijit.form.ComboBox");
</script>
 ....
<b>Combo lookup of states through QueryReadStore</b><br>
<div dojoType="dojox.data.QueryReadStore" url="/moin_static163/js/dojo/trunk/release/dojo/dojox/data/tests/stores/QueryReadStore.php" jsId="comboStore"></div>
 <div dojoType="dijit.form.ComboBox" store="comboStore" searchAttr="name" pageSize="100"></div>

QueryReadStore.php is available in svn so you could even look at what they did server side.

seth
Thanks although the performance was not as good as I had hoped. I will have to find some other way of filtering this input
Grant Collins