var flexGrid = new wijmo.grid.FlexGrid('#FlexGrid');
flexGrid.itemsSource = createData(10);
flexGrid.columns[0].isReadOnly = true;
flexGrid.columns[0].width = 180;
flexGrid.columns[1].isReadOnly = true;
flexGrid.columns[1].width = 180;
flexGrid.itemFormatter = function (panel, r, c, cell) {
if (panel.cellType == wijmo.grid.CellType.Cell) {
if (c == 0) {
cell.innerHTML = '<div style="text-align: center;"><input type="button" value="ボタン1" onmousedown="alert(' + "'ボタン1'" + ');" style="margin: -3px;" /></div>';
}
else if (c == 1) {
cell.innerHTML = '<div style="text-align: center;"><input type="button" value="ボタン2" onclick="alert(' + "'ボタン2'" + ');" style="margin: -3px;" /></div>';
}
}
}
flexGrid.selectionChanging.addHandler(function (s, e) {
if (e.col == 1) {
e.cancel = true;
}
});
function createData(count) {
var data = [];
for (var i = 0; i < count; i++) {
data.push({
mousedownイベント: '',
セル選択させない: ''
});
}
return data;
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
0
Go to list of users who liked
0