Editor, lookup field and display read-only.

Editor, lookup field and display read-only.

MickBMickB Posts: 103Questions: 25Answers: 2

I have a Datatable which I want to use for data entry.

I want the users to choose a product_id (eventually will be a Select2 which is populated from the products table), the system will then lookup the product_description (30,000 records).

I just want the description to be displayed, so the user can check they have entered the correct product_id.

The description does not need to be saved to the table, just the product_id.

Is there anyway to do this?

Cheers,

Mick

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You could use readonly or the display plug-in (which I've actually been thinking about rolling into Editor's core).

    Allan

  • MickBMickB Posts: 103Questions: 25Answers: 2

    Great. How can I get that to update, with the correct description when the product_id has been selected?

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    You'd need to set the value of the field. Probably the best way of doing that (i.e. knowing when the product_id has changed) is to use the dependent() method. Alternatively use field().input() to get the select element so you can bind your own event listener.

    Allan

This discussion has been closed.