tui.grid icon indicating copy to clipboard operation
tui.grid copied to clipboard

Tui Grid pollute original data while presenting data in table

Open dev-hobeoung opened this issue 3 years ago โ€ข 1 comments

When using tui-grid, it seems to work by adding properties such as rowKey and sortKey to the passed data.

This method seems to have the following problems. First, it pollutes the original data in the Presentation Layer. I don't think most people would expect the original data to be transformed in the process of presenting it in a table. Second, immutable objects cannot be used. In particular, since many state management libraries such as Redux manage objects immuatably, usability is limited in many case.

Even if it consumes a little more memory, it is suggested to manage it separately through depensive copy inside the tui grid.

== tui-grid ์‚ฌ์šฉ ์‹œ, ๋„˜๊ฒจ์ค€ ๋ฐ์ดํ„ฐ์— rowKey, sortKey ๋“ฑ์˜ ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ๋™์ž‘ํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

ํ•ด๋‹น ๋ฐฉ์‹์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฌธ์ œ์ ์„ ๊ฐ€์ง€๊ณ  ์žˆ์„ ๊ฒƒ์œผ๋กœ ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค. ์ฒซ๋ฒˆ์งธ, ์›๋ณธ ๋ฐ์ดํ„ฐ๋ฅผ Presentation Layer์—์„œ ์˜ค์—ผ์‹œํ‚ต๋‹ˆ๋‹ค. ๋Œ€๋ถ€๋ถ„์˜ ์‚ฌ๋žŒ๋“ค์€ ํ…Œ์ด๋ธ”์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ๊ณผ์ •์—์„œ ์›๋ณธ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณ€ํ˜•๋  ๊ฒƒ์ด๋ผ๊ณ  ์˜ˆ์ƒํ•˜์ง€ ๋ชปํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋‘๋ฒˆ์งธ, immutable ๊ฐ์ฒด๋Š” ์‚ฌ์šฉ์ด ๋ถˆ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ํŠนํžˆ, Redux ๋“ฑ ๋‹ค์ˆ˜์˜ ์ƒํƒœ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ ๊ฐ์ฒด๋ฅผ immuatableํ•˜๊ฒŒ ๊ด€๋ฆฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋งŽ์€ ์ผ€์ด์Šค์—์„œ ์‚ฌ์šฉ์„ฑ์ด ์ œํ•œ๋ฉ๋‹ˆ๋‹ค.

์•ฝ๊ฐ„์˜ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋” ์†Œ๋น„ํ•˜๋”๋ผ๋„ tui grid ๋‚ด๋ถ€์—์„œ depensive copy๋ฅผ ํ†ตํ•ด ๋”ฐ๋กœ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐฉ์•ˆ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค.

dev-hobeoung avatar Jul 27 '22 02:07 dev-hobeoung

It's label must be changed to 'Bug Report' to 'Feature Request'

dev-hobeoung avatar Jul 27 '22 02:07 dev-hobeoung

Sorry for late replying.

I agree with you, so I'll fix it. Thanks!

jajugoguma avatar Jan 09 '23 03:01 jajugoguma