Reputation: 178
I can't figure out how to make a field autocomplete in ATK.
I guess it has something to do with the type "reference" but still not sure. Suppose I'm looking for a client name in a "line" type field, then the autocomplete should list me all/topXX matching names.
Scenario 1: Once I hit [Enter] I'd need all that row from DB loaded in a form fields so I can edit the record. I guess this requires getting the client ID first then posting to an "edit" page then calling "loadData()" method for that ID and populate fields.
Scenario 2: I'm assignig a job request to a client. First I find the client then I could store its ID in a hidden field to be posted then.
Any advice? TIA
Upvotes: 1
Views: 310
Reputation: 10664
I would suggest you to go with 2 forms. First form with a single field, and when field is changed it automatically reloads second form including the parameter.
You will also need an autocomplete field. Autocomplete is somewhat buggy in 4.0, but it have been polished up in 4.1 by using a technique in http://jqueryui.com/demos/autocomplete/#combobox
For use with models and controllers and also dropdown, example is here: http://codepad.agiletoolkit.org/reloadform
Alternative example: http://demo.atk4.com/demo.html?t=22
Since 4.1, you can also use autocomplete fields instead of reference:
$form1->addField('autocomplete','user');
Upvotes: 1