- /************更改filter按钮的方法*******************/
- changeFilterButton(GCsheets, worksheet){
- worksheet.rowFilter().filterButtonVisible(false);
- let filterStyle = worksheet.getStyle(0, -1, GCsheets.SheetArea.colHeader);
- filterStyle.cellButtons = [
- {
- imageType: GCsheets.ButtonImageType.search,
- command: (worksheet, row, col, option) => {
- let filter = worksheet.rowFilter();
- let cellRect = worksheet.getCellRect(row, col);
- let x = cellRect.x;
- let y = cellRect.y;
- let filterButtonHitInfo = {
- rowFilter: filter,
- row: row, col: col,
- sheetArea: GCsheets.SheetArea.viewport,
- x: x, y: y,
- width: cellRect.width,
- height: cellRect.height
- };
- filter.openFilterDialog(filterButtonHitInfo);
- }
- }
- ];
- worksheet.setStyle(0,-1, filterStyle, GCsheets.SheetArea.colHeader);
- worksheet.resumePaint();
- },
复制代码 通过这个函数修改了表单列头的图标样式,但是点击筛选按钮没有反应,是还需要另外绑定吗
|