-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckColumn.js
37 lines (32 loc) · 995 Bytes
/
CheckColumn.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React, {useState, useEffect} from 'react';
import Styled from 'styled-components';
import moment from 'moment';
import {FormCheck} from "react-bootstrap"
const Col = Styled.div`
display: inline-block;
margin: 10px;
width: ${({width})=>width+"px"};
cursor:"pointer"
`
const Text = Styled.div`
white-space: nowrap;
overflow : hidden;
text-align : ${({align})=>align};
text-overflow: ellipsis;
flex: 1
`
export const CheckColumn = ({width=50, text, format = "string", dataIndex, align="left" , checked , onChecked,data}) => {
return (
<Col className="col" width={width} onClick={(e)=>{
e.stopPropagation();
onChecked(!checked,data)
}}>
<Text align={align}>
<input type="checkbox" checked={checked} onChange={(e)=>{e.stopPropagation()}}>
</input>
</Text>
</Col>
);
}
//onChecked(e.target.value,data)
//={rt deft Col;