jqGrid Switch a field to dropdown from text

后端 未结 1 1173
走了就别回头了
走了就别回头了 2021-01-28 15:38

Ive got a jqGrid where i have a some columns and 1 of the columns is a dropdownlist(select) populated from database.

What i want is : When im not in editmode column with

1条回答
  •  迷失自我
    2021-01-28 15:53

    What you need to do is to use

    editoptions: { dataUrl: '@Url.Action("ConstructSelect")' }
    

    instead of

    editoptions: { value: data }
    

    Depend on the format of the output of the action ConstructSelect you can need to use an additional property buildSelect of the editoptions. jqGrid expected that the server response on the HTTP 'GET' request of dataUrl will be HTML fragment which represent

    If the server return other formatted data, like JSON data

    ["Germany","USA"]
    

    or

    [{"code":"de","display":"Germany"},{"code":"us","display":"USA"}]
    

    you can write JavaScript function which convert the server response to the HTML fragment of the

    提交评论

提交回复
热议问题