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

use Pagination dataSource without edit to backend source

Open Cronian opened this issue 3 years ago โ€ข 3 comments

Summary use tui-pagination dataSource without edit to backend source, how can i change dataform before run parsing

Version grid : 4.13.0 pagination : 3.4.0

Additional context when i use tui-pagination with dataSource, i must change backend dataform.

but it canโ€™t.

how can i change dataform without edit to backend source.

โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”

Toast Pagination์—์„œ dataSource ์‚ฌ์šฉ์‹œ ์ง€์ •๋œ ํ˜•ํƒœ๋กœ ๊ฒฐ๊ณผ ๋ฐ์ดํ„ฐ๋ฅผ ๋„˜๊ฒจ์ฃผ์–ด์•ผ ์ •์ƒ ๋™์ž‘ํ•˜์ง€๋งŒ

๋ฐฑ์•ค๋“œ์˜ ๋ฐ์ดํ„ฐ ํ˜•ํƒœ๋ฅผ ๋ฐ”๊ฟ€ ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ๋ผ์„œ api:readData์—์„œ response๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์ „์— response์˜ ๋ฐ์ดํ„ฐ ํ˜•ํƒœ๋ฅผ ๋ฐ”๊ฟ”์ฃผ๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ฒฝ์šฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์†Œ์Šค๋ฅผ ์ง์ ‘ ์ˆ˜์ •ํ•˜์ง€ ์•Š๊ณ  response์˜ ํ˜•ํƒœ๋ฅผ ๋ณ€๊ฒฝ์‹œ์ผœ์ค„ ๋ฐฉ๋ฒ•์ด ์žˆ์„๊นŒ์š”?

์•„๋ž˜๋Š” ์ง์ ‘ ์‹œ๋„ํ•ด๋ณธ ๋ฐฉ๋ฒ•๋“ค์ž…๋‹ˆ๋‹ค.

  1. dataSource๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์ง์ ‘ grid์— row๋ฅผ ๊ทธ๋ ค์ฃผ๊ณ  pageOption๊ฐ’์„ ์„ค์ •ํ•ด์ค€๋‹ค
  • ์ด ๊ฒฝ์šฐ ํŽ˜์ด์ง•์˜ ๋„ค๋น„๊ฒŒ์ด์…˜ ๋ฐ”์—์„œ ๋ฒˆํ˜ธ ํด๋ฆญ ์‹œ ์ด๋ฒคํŠธ๊ฐ€ ๋™์ž‘ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ( ๋ฐ์ดํ„ฐ ์†Œ์Šค์— api๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์˜ค๋ฅ˜๋ฐœ์ƒ )
  1. grid.on('response',ev => {}); ๋ฅผ ํ†ตํ•ด ์‘๋‹ต ์‹œ ๋จผ์ € ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›์•„ ev.xhr.response ์™€ ev.xhr.responseText์˜ ๊ฐ’์„ ๋ณ€๊ฒฝํ•ด์ค€๋‹ค.
  • ์ด ๊ฒฝ์šฐ ev.xhr.response์™€ ev.xhr.responseText์˜ ๊ฐ’์ด ๋ณ€๊ฒฝ๋ถˆ๊ฐ€๋กœ ๋˜์–ด์žˆ์–ด ์ •์ƒ์ ์œผ๋กœ ์ˆ˜์ •๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ( Object.defineProperty ๋ฅผ ํ†ตํ•ด ๋ณ€๊ฒฝํ•ด๋ณด๋ ค ํ–ˆ์œผ๋‚˜ ์ •์ƒ์ ์œผ๋กœ ์ˆ˜์ •๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.)

Cronian avatar Mar 23 '22 23:03 Cronian

@Cronian Have you tried editing ev.xhr.res._body?

jajugoguma avatar Mar 30 '22 05:03 jajugoguma

@Cronian Have you tried editing ev.xhr.res._body?

in my case, ev.xhr.res is not exist.. (Spring framework 4.3.29 & Tomcat 9.0)

Cronian avatar Mar 30 '22 09:03 Cronian

This issue has been automatically marked as inactive because there hasnโ€™t been much going on it lately. It is going to be closed after 7 days. Thanks!

stale[bot] avatar Apr 30 '22 08:04 stale[bot]

This issue will be closed due to inactivity. Thanks for your contribution!

stale[bot] avatar Nov 13 '22 21:11 stale[bot]

This issue will be closed due to inactivity. Thanks for your contribution!

stale[bot] avatar Jan 08 '23 02:01 stale[bot]