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?

4

1 に答える 1

2

ああ少年!

私はずっと答えを持っていました。それは私が望んでいたのと同じくらい簡単でした。

方法は次のとおりです。

ship:["FedEx","TNT"]

うまくいかなかった理由は、jqGrid がデータを「FedEx、TNT」として表示し、それが単なる文字列であると信じ込ませたためです。セルをクリックして何が起こったのかを確認する代わりに、インターネットで答えを探すのに何時間も費やしました. 何が起こったのか知りたい場合は; jqGrid は、両方の要素が選択された選択リストをレンダリングします。単純。

ハッピーjqGrid'ing!

于 2009-08-22T18:48:38.373 に答える