您好,您可以使用慢板工具来实现这样的功能,我给您提供部分示例代码,请参照:
- // template for "Template" cells
- var theTemplate = '<a>操作</a>';
- // grid with template
- var theGrid = new wijmo.grid.FlexGrid('#theGrid', {
- autoGenerateColumns: false,
- columns: [
- { binding: 'country', header: 'Country' },
- { binding: 'template', header: 'Template', width: 130, isReadOnly: true },
- { binding: 'sales', header: 'Sales', format: 'n2' },
- { binding: 'expenses', header: 'Expenses', format: 'n2' }
- ],
- itemsSource: getData(),
- showAlternatingRows: false,
- formatItem: function(s, e) {
- if (e.panel == s.cells && s.columns[e.col].binding == 'template') {
- var item = s.rows[e.row].dataItem,
- html = wijmo.format(theTemplate, item);
- e.cell.innerHTML = html;
- }
- }
- });
复制代码 |