Order + filter with formatted data
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
リンクされた CodeSandbox から始め、react-table 8.9.3 における cell、accessorFn、getValue と、ソートおよびフィルタリングの挙動を使って列定義を比較してください。各操作で元の値とフォーマット済みの値がどのように公開されるかを追跡し、そのうえで、再現したケースが元の日付または数値で並べ替えながら、フォーマット済みの表示値でフィルタリングできることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
i need to transform the data to show to the user.
Eg from YYYY-MM-DD to DD/MM/YYYY,
from usd 10.99 to usd 10,99.
Anyway, to order i need to use de original data ( a date or decimal number), to filter i need to use the transformed data or both.
dont exist a property in the row with columnId to return the transformed data (row.original, row.getValue and row.renderValue just return the original data).
i tried to pass the transformed data thru accessorFn: row => formatDate(row.field), but with this approach, i lose the original data in order function, and ordering with transformatted data gives me a wrong ordenation.
how to solve this problem?
Your minimal, reproducible example
https://codesandbox.io/s/nice-ishizaka-s2n6mw?file=/src/App.tsx
Steps to reproduce
create a row
{
header: "name",
accessorKey: "nameKey",
cell: ({getValue}) => formatDate(getValue())
},
// this option i lose the formatted data to filter
or
{
header: "name",
id: 'nameKey',
accessorFn: row => formatDate(row.date),
},
// this option i lose the original data to order
const formatDate = (date: string | Date, format?: string) => {
// console.log("date", date)
format = format || 'dd/MM/yyyy';
return dateFormat(toDate(date), format);
};
Expected behavior
order by original data and filter by transformed data
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
all Operating System and Browsers
react-table version
8.9.3
TypeScript version
5.2.2
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- 主要言語
- TypeScript
- スター
- 28.5k
- フォーク
- 3.6k
- 平均マージ
- 19時間 40分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/table のほかの issue
-
Issue template renders `react-table`, not `TanStack/table`対応中かも @vishruthasgowda が 13 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
TanStack/table#6595 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
TanStack/table#6601 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Cast required to access custom options when defining a custom plugin/feature対応中かも @sorena-paydar が 14 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`対応中かも @cpruijsen が 25 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bot:ai-assisted status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
midnightntwrk/midnight-js#1424 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mksglu/context-mode#1268 ·
メンテナーはふだん 5 日以内に返信
-
[bug] Setup fails with "Cannot find matching keyid" when an older Node's corepack is on PATH対応中かも @EyalPoly が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MystenLabs/MemWal#1124 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Edit:オープンcheck:failed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
iptv-org/iptv#54352 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信