0

I'm setting up a jqGrid which needs to visualize multiple values in one cell. The input comes from a form where the user can select multiple choices. I am able to display the select box, but not populate it. I have tried to insert an array in the JSON object, but to no success.

This is the model:

index:'ship', editoptions:{multiple:true, value:{1:”FedEx”,2:”InTime”,3:”TNT”,4:”ARAMEX”}}

And here are some variations of the data I've tried populating with:

ship:{[1],[4]}
ship:[[1],[4]]
ship:{value:{1,4}}

...and lots of other variations.

I've also searched the jqGrid forum, but didn't find a solution. How can I fix this problem?

honk
  • 9,137
  • 11
  • 75
  • 83
mandarin
  • 21
  • 1
  • 3

1 Answers1

2

Oh boy!

I had the answer all the time. It was just as easy as I had hoped it would be.

Here's how it's done:

ship:["FedEx","TNT"]

The reason for why I didn't think it worked is because jqGrid shows the data as "FedEx, TNT", thus making me believe it was only a string. Instead of clicking the cell to see what had happend, I spent hours looking for the answer on the internet. If you'd like to know what happends; jqGrid renders a select list with both elements selected. Simple.

Happy jqGrid'ing!

mandarin
  • 21
  • 1
  • 3