! 제품 버전을 정확하게 입력해 주세요.
제품 버전이 정확하게 기재되어 있지 않은 경우,
최신 버전을 기준으로 안내 드리므로
더욱 빠르고 명확한 안내를 위해
제품 버전을 정확하게 입력해 주세요!

FlexGrid itemFormatter > Q&A | 토론

본문 바로가기

ReactJS FlexGrid itemFormatter

페이지 정보

작성자 moon7 작성일 2023-06-26 16:45 조회 1,126회 댓글 0건
제품 버전 : 5.20221.842
컨트롤 이름 : FlexGrid

본문

첨부파일

FlexGrid itemFormatter 사용후 useState를 이용한 input데이터 입력시 그리드 깜밖임 현상이 발생합니다.
추측으로는 useState 업데이트시 그리드를 다시 그리는것 같습니다.

깜빡임 증상을 제거 하고 싶은데 어떻게 처리하면 될지 확인 부탁 드립니다.

참고 할수있게 증상 영상파일로 첨부하였습니다. 확인 부탁 드립니다.
 

  • 페이스북으로 공유
  • 트위터로  공유
  • 링크 복사
  • 카카오톡으로 보내기

댓글목록

등록된 댓글이 없습니다.

3 답변

ReactJS Re: FlexGrid itemFormatter

추천0 이 글을 추천하셨습니다 비추천0

페이지 정보

작성자 GCK루시 작성일 2023-06-27 12:01 댓글 0건

본문

안녕하세요 그레이프시티입니다.


문의하신 이슈가 안타깝게도 저희 쪽에서 재현이 되지 않아 정확한 원인 파악이 어려운 상황입니다. 아래 기본 샘플을 공유드리오니 해당 샘플을 바탕으로 저희 쪽으로 재현 가능한 샘플을 전달해주시기 바랍니다.


공유해주신 샘플을 바탕으로 재현 및 디버깅 후, 안내 드릴 수 있도록 하겠습니다.



감사합니다.

그레이프시티 드림 

댓글목록

등록된 댓글이 없습니다.

ReactJS Re: FlexGrid itemFormatter

추천0 이 글을 추천하셨습니다 비추천0

페이지 정보

작성자 moon7 작성일 2023-06-29 11:24 댓글 0건

본문

Sandbox 에서도 동일하게 증상이 발생 하네요


아래 소스코드 첨부 합니다.

import "./styles.css";
import * as React from "react";
import "@grapecity/wijmo.styles/wijmo.css";
import * as wjCore from "@grapecity/wijmo";

import * as ReactDOM from "react-dom";
import * as wjcGrid from "@grapecity/wijmo.react.grid";
import * as wjGrid from "@grapecity/wijmo.grid";
wjCore.setLicenseKey(window.evalkey);

export default function App() {
const grid = React.createRef(null);
const [source, setSource] = React.useState(
new wjCore.CollectionView(getData())
);
const [text, setText] = React.useState('')


function initialized(s) {}

return (
<div className="App">
<div className="container-fluid">
<input value={text} onChange={(e) => setText(e.target.value)}/>
<wjcGrid.FlexGrid
itemsSource={source}
initialized={initialized}
ref={grid}
itemFormatter={()=>{}}
>
<wjcGrid.FlexGridColumn
binding="id"
header="ID"
width={60}
isReadOnly={true}
/>
<wjcGrid.FlexGridColumn binding="country" header="Country" />
<wjcGrid.FlexGridColumn binding="product" header="Product" />
<wjcGrid.FlexGridColumn binding="sales" header="Sales" />
<wjcGrid.FlexGridColumn binding="expenses" header="Expenses" />
</wjcGrid.FlexGrid>
</div>
</div>
);
}

function getData() {
// create some random data
let countries = "US,Germany,UK,Japan,Italy,Greece".split(","),
products = "Phones,Computers,Cameras,Stereos".split(","),
data = [];
for (let i = 0; i < 5; i++) {
data.push({
id: i,
country: countries[i % countries.length],
product: products[i % products.length],
sales: Math.random() * 10000,
expenses: Math.random() * 5000
});
}
return data;
}
 

댓글목록

등록된 댓글이 없습니다.

ReactJS Re: FlexGrid itemFormatter

추천0 이 글을 추천하셨습니다 비추천0 채택채택

페이지 정보

작성자 GCK루시 작성일 2023-06-29 16:46 댓글 0건

본문

안녕하세요 그레이프시티입니다.


문의하신 이슈의 경우, itemFormatter가 React 컴포넌트 요소에 직접 추가된 후 input에 텍스트 입력 시 itemFormatter가 렌더링 영향을 받아 실행되어 해당 현상이 나타나는 것으로 추측됩니다. 먼저 해당 이슈를 해결하기 위해서는 아래 코드와 같이 itemFormatter를 그리드 초기화 이벤트 내에서 선언하여 사용해보시기 바랍니다.


  function initialized(s) {
    s.itemFormatter = function (panel, r, c, cell) {
      console.log("r = " + r);
      console.log("c = " + c);
    };
  }

(...)
<wjcGrid.FlexGrid
    itemsSource={source}
    initialized={initialized}
    ref={grid}
    // itemFormatter={() => {}}
>


다른 궁금한 점이 생기면 문의 주시기 바랍니다.


감사합니다.

그레이프시티 드림

댓글목록

등록된 댓글이 없습니다.

메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
이메일 : sales-kor@mescius.com | 전화 : 1670-0583 | 경기도 과천시 과천대로 7길 33, 디테크타워 B동 1107호 메시어스(주) 대표자 : 허경명 | 사업자등록번호 : 123-84-00981 | 통신판매업신고번호 : 2013-경기안양-00331 ⓒ 2024 MESCIUS inc. All rights reserved.