| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 
- react ag grid
 - 자바 공배수
 - 자바 향상된 for문
 - 프로그래머스
 - 자바 자동캐스팅
 - 항해99 2기
 - java
 - 자바 switch문
 - TypeScript
 - 자바 while문
 - 자바 for문
 - 자바 삼항연산자
 - 타입스크립트
 - Til
 - 변수
 - 자바 스캐너
 - 자바 반복문
 - 조코딩
 - react with typescript
 - 자바 조건문
 - 자바 강제 캐스팅
 - 이클립스 DB연동
 - Vue3
 - 자바 public
 - 자바 if문
 - 자바 구구단 출력
 - MySQL
 - 항해99
 - 자바
 - 정보처리기사실기
 
- Today
 
- Total
 
뇌 채우기 공간
[TIL] 20211207 react-table editable/ fixed column/ css 본문
1. react table editable
https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/editable-data
tannerlinsley/react-table: editable-data - CodeSandbox
tannerlinsley/react-table: editable-data using namor, react, react-dom, react-scripts, react-table, styled-components
codesandbox.io
https://react-table.tanstack.com/docs/examples/editable-data
Examples: Editable Data
Subscribe to our newsletter The latest TanStack news, articles, and resources, sent to your inbox.
react-table.tanstack.com
2. react input focus blur event
const inputRef = useRef();
const handleKeyPress = (e) => {
    if(e.key === 'Enter') {
      console.log('enter')
      inputRef.current.blur();
    }
  }
return <input 
            value={value} 
            onChange={onChange} 
            onBlur={onBlur} 
            css={inputStyle}
            onKeyPress={handleKeyPress}
            ref={inputRef}
            />
3. react-table fixed column
http://www.recompile.in/2019/11/react-fixed-table-header-code-without.html
https://codesandbox.io/s/react-table-fixed-columns-official-kowzlm5jp7
https://gojjc.tistory.com/entry/reactReact-Table-지정-컬럼-고정시키하기
[React] React-Table 지정 컬럼 고정시키하기
React-Table에서 컬럼을 고정하는 방법을 공유합니다. 1. 우선react-table-hoc-fixed-columns react 모듈 을 설치한다. 참조: https://www.npmjs.com/package/react-table-hoc-fixed-columns npm install rea..
gojjc.tistory.com
4. table view 에 border넣기
https://www.codingfactory.net/10510
CSS / 표(table) 꾸미기 / 테두리 만들기
테두리 만드는 속성 테두리는 border 속성으로 만듭니다. table, th, td 요소에 적용할 수 있습니다. tr 요소에는 적용되지 않습니다. 기본 모양 아무런 꾸밈을 하지 않았다면 기본 모양은 테두리가 없
www.codingfactory.net
5. editable table에서 input타입을 동적으로 렌더링 하고 싶음
// import makeData from './makeData'
const EditableCell = ({
  value : initialValue,
  row : {index},
  column : {id},
  updateMyData,
}) => {
  const [value, setValue ] = useState(initialValue);
  const [type, setType] = useState('type');
  const inputRef = useRef();
  const onChange = e => {
      setValue(e.target.value);
  }
  const onBlur = () => {
    updateMyData()
  }
  const handleKeyPress = (e) => {
    if(e.key === 'Enter') {
      inputRef.current.blur();
    }
  }
  useEffect(()=>{
      setValue(initialValue)
      setType(typeof value)
  },[initialValue])
  return <input 
            value={value} 
            onChange={onChange} 
            onBlur={onBlur} 
            css={inputStyle}
            onKeyPress={handleKeyPress}
            ref={inputRef}
            type={type}
            />
}'TIL' 카테고리의 다른 글
| [TIL] 20211209 react-query/select tag value/react-table-sticky (0) | 2021.12.14 | 
|---|---|
| [TIL] 20211208 react hook form yup/ position absolute/classnames (0) | 2021.12.10 | 
| [TIL] 20211206 react 라이브러리들 (0) | 2021.12.08 | 
| [TIL] 20211203 react table/ react css / emotion.js / @emotion.react (0) | 2021.12.08 | 
| [TIL] 20211202 redux toolkit / moments.js/ react hook error (0) | 2021.12.06 |