Link to home
Start Free TrialLog in
Avatar of NetExpert-Warszawa
NetExpert-WarszawaFlag for Poland

asked on

Dojo ComboBox autocompletion

I use Zend Framework to create a form element of type Zend_Dojo_Form_Element_ComboBox. I set dojox.data.QueryReadStore as a store type.

The final effect is I have got an input in my HTML. The store is queried and I receive a list of possible values. I can select one or enter my own. Everything is OK so far.

The data that is stored in the field is not an identifier of the store. The store data is like:
{"identifier":"id","items":[
  {"id":18,"d1":"xxxxxx","d2":"yyyyyyyyyy"},
  {"id":22,"d1":"xxxxxx","d2":"zzzzzz"},
  {"id":18,"d1":"xxxxxxaaaa","d2":"aaaaaaaaaaaa"}
],"label":"something"}
Let's say d1 is taken as a value.

Now I want to use d2 to populate another field in a form. What should I do? Can I do it on a Zend's side? I have tried to dojo.connect to the combo box, but do not know how to retrieve correct data from the store.
ASKER CERTIFIED SOLUTION
Avatar of Amar Bardoliwala
Amar Bardoliwala
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NetExpert-Warszawa

ASKER

Thanks for a reply. I am starting to get the idea :)
However it does not work for me as expected.

console.log(dojo.byId('input_id'));
<input ...>
console.log(dojo.byId('input_id').store);
undefined
console.log(dojo.byId('input_id').query);
undefined
The answer does not solve my problem. However thanks for a link to valuable examples.