Skip to content

Commit

Permalink
test/grid2.html
Browse files Browse the repository at this point in the history
Change ‘int’ and ‘check’ column, now only records with an odd ‘redid’
are editable.
  • Loading branch information
ceedriic committed May 30, 2016
1 parent 287a811 commit 95b94bb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/grid2.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
toolbar: true,
footer: true,
header: true,
emptyRecords: true,
emptyRecords: false,
selectColumn: true,
expandColumn: false,
columnHeaders: true,
Expand All @@ -41,7 +41,11 @@
// selectType: 'cell',
columns: [
{ field: 'recid', caption: 'ID', size: '80px', sortable: true, searchable: 'int', frozen: true },
{ field: 'int', caption: 'int', size: '80px', sortable: true, resizable: true, editable: { type: 'int', min: 0, max: 100 } },
{ field: 'int', caption: 'int', size: '80px', sortable: true, resizable: true,
editable: function (record, index, col_index, data) {
// only odd 'recid' records are editable
if (record.recid % 2) return { type: 'int', min: 0, max: 100 };
} },
{ field: 'money', caption: 'money', size: '80px', sortable: true, resizable: true, editable: { type: 'money' }, render: 'money' },
{ field: 'percent', caption: 'percent', size: '80px', sortable: true, resizable: true, editable: { type: 'percent' }, render: 'percent' },
{ field: 'hex', caption: 'hex', size: '80px', sortable: true, resizable: true, editable: { type: 'hex' } },
Expand All @@ -62,7 +66,11 @@
return html;
}
},
{ field: 'check', caption: 'check', size: '40px', sortable: true, resizable: true, editable: { type: 'checkbox' } }
{ field: 'check', caption: 'check', size: '40px', sortable: true, resizable: true,
editable: function (record, index, col_index, data) {
// only odd 'recid' records are editable
if (record.recid % 2) return { type: 'checkbox' }
} },
// { field: 'enum', caption: 'enum', size: '380px', sortable: true, resizable: true, editable: { type: 'enum', items: people } },
// { field: 'file', caption: 'file', size: '80px', sortable: true, resizable: true, editable: { type: 'file' } },
// { field: 'radio', caption: 'radio', size: '80px', sortable: true, resizable: true, editable: { type: 'radio' } },
Expand Down

0 comments on commit 95b94bb

Please sign in to comment.