How to display different values ​​in jqGrid column

I have a jGrid with an editable column some_other_idthat has a select drop down menu with keys / values 1:A,2:B,3:C. I want the selected selection in each row to display the text value of the selection (for example, "A", "B", "C"), and not the identifier (1, 2, or 3). The identifier is currently displayed.

colModel :[
    { label: 'ID', name:'id' },
    { 
        label: 'Some Other ID',
        name: 'some_other_id',
        editable: true,
        align: 'center',
        edittype: "select",
        editoptions: {value:"1:A,2:B,3:C"}
    },
],

How to make display the selected text value from editoptionsinstead?

+3
source share
2 answers

Just use formatter:'select'in the column model

Link: trirand_jqgridwiki_wiki: predefined_formatter

+3
source

, , jqGrid :

value: {1:'A',2:'B'}

:

value: "5:'A';4:'B'"

, .

0

Source: https://habr.com/ru/post/1734961/


All Articles