jqGrid - how to have hidden fields in an edit form

2019-02-25 06:17发布

I want to be able to pass fields into the edit form when a user attempts to edit a row, but I don't want these fields to be editable - I want them to just be hidden so they still get sent to the server.

For instance:

colModel :[
    {label: 'Game ID', name: 'game_id', editable:true},
    {label: 'Component ID', name: 'component_id', editable:true},
    {label: 'Table ID', name: 'table_id', editable:true},
],

This will pass them to the edit form (because of editable:true) but unfortunately they will be editable by the user. I want to hide these fields so the user can't edit them.

How can I do this?

标签: jquery jqgrid
7条回答
唯我独甜
2楼-- · 2019-02-25 07:07

try this:

colModel: [
    { name: 'your_field_name', editable: true, hidden: true, search:false, editoptions: {style:'display:none;'}},
]
查看更多
登录 后发表回答