bee-table7/demo/demolist/Demo13.js

72 lines
1.3 KiB
JavaScript
Raw Normal View History

/**
*
2017-09-18 15:18:42 +08:00
* @title 列排序全选功能
* @description 列排序全选功能
*
*/
import React, { Component } from "react";
import Table from "../../src";
import Checkbox from "bee-checkbox";
2017-09-18 15:18:42 +08:00
import multiSelectFunc from "../../src/lib/multiSelectFunc.js";
import sortFunc from "../../src/lib/sortFunc.js";
const columns13 = [
{
title: "名字",
dataIndex: "a",
key: "a",
width: 100
},
{
title: "性别",
dataIndex: "b",
key: "b",
width: 100
},
{
title: "年龄",
dataIndex: "c",
key: "c",
width: 200,
sorter: (a, b) => a.c - b.c
},
{
title: "操作",
dataIndex: "",
key: "d",
render() {
return <a href="#">一些操作</a>;
}
}
];
const data13 = [
{ a: "杨过", b: "男", c: 30, key: "2" },
{ a: "令狐冲", b: "男", c: 41, key: "1" },
{ a: "郭靖", b: "男", c: 25, key: "3" }
];
class Demo13 extends Component {
2017-09-18 15:18:42 +08:00
getSelectedDataFunc = (data) =>{
console.log(data)
}
render() {
let multiObj = {
type: "checkbox",
param: "key"
};
2017-09-18 15:18:42 +08:00
let ComplexTable = multiSelectFunc(sortFunc(Table));
return (
<div>
<ComplexTable
columns={columns13}
data={data13}
multiSelect={multiObj}
2017-09-18 15:18:42 +08:00
getSelectedDataFunc={this.getSelectedDataFunc}
/>
</div>
);
}
}
export default Demo13;