你好,可以实现,参考以下代码:
- import 'bootstrap.css';
- import '@grapecity/wijmo.styles/wijmo.css';
- import './styles.css';
- //
- import * as wjCore from '@grapecity/wijmo';
- import * as wjInput from '@grapecity/wijmo.input';
- import * as wjMultiRow from '@grapecity/wijmo.grid.multirow';
- import { generateAppData } from './data';
- //
- document.readyState === 'complete' ? init() : window.onload = init;
- //
- function init() {
- let appData = generateAppData();
- let orders = appData.orders;
- let layoutDefs = appData.layoutDefs;
- let currentLayout = appData.layoutDefs.currentItem;
- let multirow = new wjMultiRow.MultiRow('#multirow', {
- itemsSource: orders,
- layoutDefinition: currentLayout.def
- });
-
- multirow.formatItem.addHandler(function (s, e) {
- // center-align column headers
- if (e.panel == s.columnHeaders) {
- console.log(e);
- }
- // custom rendering for "Diff" columns
- if (e.panel == s.cells) {
- var col = s.columns[e.col];
- if (e.row > 0 && (col.binding == 'email')) {
- console.log(e)
- }
- }
- });
- let ldComboBox = new wjInput.ComboBox('#ldComboBox', {
- itemsSource: layoutDefs,
- displayMemberPath: 'name'
- });
- updateDescription();
- layoutDefs.currentChanged.addHandler(() => {
- currentLayout = appData.layoutDefs.currentItem;
- updateMultirow();
- updateDescription();
- });
- //
- function updateMultirow() {
- multirow.layoutDefinition = currentLayout.def;
- }
- //
- function updateDescription() {
- wjCore.setText(document.querySelector('#desc'), currentLayout.description);
- }
- }
复制代码
参考方法:
1、打开MultRow示例,替换app.js的代码,点运行2、查看控制台。
参考相关示例:
条件格式单元格
|