English 中文(简体)
How to make a field "autocomplete"?
原标题:

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

最佳回答

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 );
问题回答

暂无回答




相关问题
C# Form Problem: new form losing control and randomly hiding

I m encountering strange behavior with forms on a c# 3.5 app. On a button click, my form1 hides itself, creates a new form2, and shows form2. Form1 also contains the event method triggered when ...

TCPlistener.BeginAcceptSocket - async question

Some time ago I have payed to a programmer for doing multithread server. In the meantime I have learned C# a bit and now I think I can see the slowndown problem - I was told by that guy that nothing ...

RoR: before_save on nested object in form?

I have a form with a nested object (customer < order), and it works except that it keeps creating a new customer record. I d like to have it check to see if an existing customer is already ...

Receive POST from External Form

I have a form on another website (using a different backend) that I want to be able to POST to my Rails application (on a different domain). How do I generate a valid authenticity token for the ...

Getting posted values in MVC PartialView

I ve created a PartialView which I render with Html.RenderPartial, passing the name of the view and the strongly-typed data item to bind to (below): <% Html.RenderPartial("...

Recaptcha - Form Customization

Does anyone know if recaptcha can be fully customize without the default frame. I need the recaptcha image to only be a certain width as well as the input field. Has anyone done this before with ...

Better way to retain form data on manual back redirect?

I have a form that, on submit, requires the customer to look over the data, and then confirm the changes before saving the data. However, I m using a really rough way of retaining data if the user ...

热门标签