0

I have 3 database tables. The first is users, the second is tasks and the third is tasks_per_user, where i store the relations between users and tasks. A user can have many tasks (or all) and each tasks may belong to many users.

What i want is to create in jqGrid a Multiple Selection Element, where i can list the selected tasks per user, but also be able to change it. I want the list element to present all the available tasks from the tasks table while present as selected the ones that are stored in the tasks_per_user for the specific user.
I have managed to do this for a single select element but i can't make it work for multiple.
Is this possible?

tliokos
  • 3,606
  • 3
  • 28
  • 28

1 Answers1

0

If I understand you correct you need fill tasks column as comma separated tasks of the user. The tasks column column can have

edittype: "select", editoptions: { multiple: true, value: "..." }

where the value or dataUrl provide the list of possible tasks. See the demo from the answer and the demo from another answer. I recommend you additionally to read the answer which describes a bug in IE7/IE8 with the corresponding bug fix.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Sorry guys. Stack with boss!! Thanks for the responses. What i want is to to represent the tasks for each user in the users table. Give me a minute to check the answers Oleg provided. – tliokos Mar 16 '12 at 12:15
  • I have managed to create a multiple select list in the form, but all options are unchecked. How can i pass the selected values from the database join? – tliokos Mar 16 '12 at 12:23
  • @Theodore: Look at the demo which I posted. If you start to *modify* list of options the current options are preselected. – Oleg Mar 16 '12 at 12:27