1

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

4

1 に答える 1

1

2つのフォームを使用することをお勧めします。1 つのフィールドを持つ最初のフォーム。フィールドが変更されると、パラメーターを含む 2 番目のフォームが自動的に再読み込みされます。

オートコンプリート フィールドも必要です。オートコンプリートは 4.0 では多少バグがありますが、4.1 ではhttp://jqueryui.com/demos/autocomplete/#comboboxのテクニックを使用して洗練されています。

モデルとコントローラー、およびドロップダウンで使用する場合の例は、http: //codepad.agiletoolkit.org/reloadformです。

代替例: http://demo.atk4.com/demo.html?t=22

4.1 以降、参照の代わりにオートコンプリート フィールドを使用することもできます。

 $form1->addField('autocomplete','user');
于 2011-04-20T19:42:37.087 に答える