|
在 extjs 6.0下,把 .x-grid-row-selected 改为 .x-grid-item-selected 应该就可以了
- var grid = F(grid2ID), gridEl = $(grid.el.dom);
- var checkboxSelector = '.powers input[type=checkbox]',
- selectedRowSelector = '.x-grid-row-selected',
- selectedRowCheckboxSelector = selectedRowSelector + ' ' + checkboxSelector;
-
- F(grid2ID).on('beforeitemcontextmenu', function (view, record, item, index, event) {
- F(menuID).showAt(event.getXY());
- event.stopEvent();
- });
- function selectCheckbox(checked) {
- var selectedRows = gridEl.find(selectedRowSelector);
- if (selectedRows.length) {
- gridEl.find(selectedRowCheckboxSelector).prop('checked', checked);
- } else {
- gridEl.find(checkboxSelector).prop('checked', checked);
- }
- }
- F(menuSelectRows).on('click', function () {
- selectCheckbox(true);
- });
复制代码
|
|