nillud-data-table 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,6 +24,7 @@ yarn add nillud-data-table
24
24
 
25
25
  ```tsx
26
26
  import { DataTable } from 'nillud-data-table'
27
+ import 'nillud-data-table/styles.css'
27
28
 
28
29
  const columns = [{ field: 'name', title: 'Имя' }]
29
30
  const data = [{ name: 'Иван' }]
@@ -37,6 +38,7 @@ const data = [{ name: 'Иван' }]
37
38
 
38
39
  ```tsx
39
40
  import { DataTable } from 'nillud-data-table'
41
+ import 'nillud-data-table/styles.css'
40
42
 
41
43
  const columns = [{ field: 'name', title: 'Имя' }]
42
44
  const data = [{ name: 'Иван' }]
@@ -494,3 +496,25 @@ groupBy={'status'}
494
496
  ```tsx
495
497
  isTitles
496
498
  ```
499
+
500
+ ### Возможности useRef
501
+
502
+ Возможность подключиться напрямую к таблице и получить данные после всех манипуляций
503
+
504
+ ```tsx
505
+ import { useRef } from "react";
506
+
507
+ const tableRef = useRef<DataTableRef>(null);
508
+
509
+ <DataTable
510
+ ...
511
+ ref={tableRef}
512
+ ...
513
+ />
514
+
515
+ const func = () => {
516
+ const data = tableRef.current.getData() // Получить текущие данные, после сортировки и фильтрации
517
+ const currData = tableRef.current.getCurrentData() // Получить данные с текущей таблицы пагинации
518
+ }
519
+
520
+ ```