我有一个 koGrid,我只想从行中选择一些单元格(2 个单元格)。如果使用canSelectRows: true
属性,我可以选择整行 - 我不需要这个。如何从 koGrid 行中选择某些单元格?
网格来源:
this.gridOptions = {
data: self.people,
enablePaging: true,
pagingOptions: self.pagingOptions,
useExternalSorting: true,
sortInfo: self.sortingOptions,
enableColumnResize: false,
keepLastSelected: false,
multiSelect: true,
showColumnMenu: false,
showFilter: false,
canSelectRows: false,
columnDefs: [{
field: "Age",
displayName: "Age",
width: "33.3%",
sortable: true
},
{
field: "Address",
displayName: "Address",
width: "33%",
sortable: true
},
{
field: "Website",
displayName: "Website",
cellTemplate:
'<div>' +
' <a data-bind="attr: {href:\'linkAddress'">People</a>' +
'</div>',
width: "33%"
}],
selectedItems: self.selectedItems,
plugins: [new koGridSetDefaultSortingPlugin(this.sortingOptions), new koGridSetNextPagePlugin()]
};