flexGrid拖拽列名到分组面板,是否还可以按照拖拽列排序
flexGrid拖拽列标题到分组面板上,是否还可以按照拖拽的列来排序?如下图,我拖拽了3列,是否可以按照这3列同时来排序。(既:先按照订单号排序,再按照商业代号排序,再按照箱号排序),是否可以?您好,支持多列排序,请参考示例:
https://www.grapecity.com/wijmo/demos/Grid/Grouping/GroupPanel/purejs
用以下代码替换app.js即可:
import 'bootstrap.css';
import '@grapecity/wijmo.styles/wijmo.css';
import './styles.css';
//
import '@grapecity/wijmo.touch'; // support drag/drop on touch devices
import * as wjGrid from '@grapecity/wijmo.grid';
import { AllowSorting } from '@grapecity/wijmo.grid';
import * as wjGridGrouppanel from '@grapecity/wijmo.grid.grouppanel';
//
document.readyState === 'complete' ? init() : window.onload = init;
//
function init() {
//
// generate some random data
var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','), products = 'Phones,Computers,Cameras,Stereos'.split(','), data = [];
for (var i = 0; i < 200; i++) {
data.push({
id: i,
country: countries,
product: products,
downloads: Math.round(100 + Math.random() * 10000),
sales: Math.random() * 10000,
expenses: Math.random() * 5000,
});
}
//
// create group panel grid
var theGrid = new wjGrid.FlexGrid('#theGrid', {
itemsSource: data,
allowSorting: AllowSorting.MultiColumn
});
//
// create the group panel
var theGroupPanel = new wjGridGrouppanel.GroupPanel('#theGroupPanel', {
placeholder: 'Drag columns here to create groups',
grid: theGrid
});
}
没有拖拽列标题到分组时是可以多列排序的,但是拖到分组面板时就没法多列排序了? 你好,经测试,可以支持分组面板中多列排序,如图:
请确保您引用的版本是最新版本,npm地址:
https://www.npmjs.com/~grapecity
页:
[1]