Oleksii
Oleksii

Reputation: 782

jqGrid default checked checkboxes

I made subgrid and want that be checkboxes were checked by default.

colModel: [
        {
            name: 'enb', index: 'enb', width: 60, align: 'center', editable: true,
            formatter: 'checkbox', editoptions: { value: 'Yes:No', defaultValue 'Yes' },
            formatoptions: { disabled: false }
        }]

But for some reason this does not occur. I use jqGrid 4.4.4 version. What i do wrong?

Upvotes: 0

Views: 471

Answers (2)

furkanali89
furkanali89

Reputation: 148

I am using this code everthing working fine.

        {
        name: 'enb', index: 'enb', width: 60, align: 'center', editable: true,
        formatter: 'checkbox', editoptions: { value:"1:0"},
        formatoptions: { disabled: false }
        }

Upvotes: 0

Oleg
Oleg

Reputation: 221997

I'm not sure that I understand you correctly what you mean under "want that be checkboxes were checked by default". If you use editoptions: { value: 'Yes:No', defaultValue 'Yes' } during editing of existing data then defaultValue will be not used. Only if you add new data for example using Add button of form editing then the checkboxes in the Add form will be checked by default.

Upvotes: 1

Related Questions