frappe/datatable
소개
웹에 없던 JavaScript 데이터 테이블
기타 프로젝트What you can do
- Cell: Enable editing within individual cells and features like custom formatters, inline editing, and mouse selection. Users can easily copy cell content, navigate through cells using the keyboard, and take advantage of a custom cell editor for advanced functionality.
- Freeze a column from its header menu so it stays in view while scrolling sideways, or set sticky: true on the column.
- Column widths fit the widest value in all rows, and widths a user resized are kept when the data refreshes.
- Set sortValue on a column to sort on a value other than the cell content.
측정된 스타 증가
- in 24h
- +1
- in 7 days
- +2
- in 15 days
- +2
- in 1 month
- -1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalFrappe DataTable
A modern datatable library for the web
https://github.com/user-attachments/assets/86b37ba6-6f7a-4996-ac63-23407793bec3
Frappe Datatable
Frappe DataTable is a simple, modern and interactive datatable library for displaying tabular data. Originally built for ERPNext, it can be used to render large amount of rows without sacrificing performance and has the basic data grid features like inline editing and keyboard navigation. It does not require jQuery, unlike most data grids out there.
Motivation
I was trying to remove all legacy UI components from the frappe codebase. We were using SlickGrid for rendering tables. It was unmaintained and UI was dated. Other datatable solutions either didn't have the features we needed or were closed source. So we built our own.
Key Features
- Cell: Enable editing within individual cells and features like custom formatters, inline editing, and mouse selection. Users can easily copy cell content, navigate through cells using the keyboard, and take advantage of a custom cell editor for advanced functionality.
- Column: Columns are highly flexible, allowing users to reorder, resize, and sort them with ease. Additional features include hiding/removing columns and adding custom actions.
- Freeze a column from its header menu so it stays in view while scrolling sideways, or set
sticky: trueon the column. - Column widths fit the widest value in all rows, and widths a user resized are kept when the data refreshes.
- Set
sortValueon a column to sort on a value other than the cell content.
- Freeze a column from its header menu so it stays in view while scrolling sideways, or set
- Row: Rows support advanced interactions, including row selection, tree-structured organization, and inline filters for precise control. They handle large datasets efficiently with dynamic row heights.
- In tree view, sorting keeps child rows under their parent.
- Total rows (
is_total_row) and blank rows keep their place when the table is sorted.
- Options:
serialNoColumnLabelsets the header of the serial number column.saveSortingremembers the last sort in local storage, undersortingKeywhen it is set. - Fuzzy filter: set
filterMode: 'fuzzy'on the table, or on a single column, so an inline filter matches letters typed in order with gaps allowed (jdmrfinds "Jordan Moreau"). Each word matches on its own, in any order, and a word of four or more letters may have one typo (saftwarefinds "Software"). Number filters such as>100work as before.
Usage
yarn add frappe-datatable
# or
npm install frappe-datatable
Note:
sortablejsis required to be installed as well.
const datatable = new DataTable('#datatable', {
columns: [ 'First Name', 'Last Name', 'Position' ],
data: [
[ 'Don', 'Joe', 'Designer' ],
[ 'Mary', 'Jane', 'Software Developer' ]
]
});
Browser Support
DataTable works in current versions of Chrome, Edge, Firefox and Safari. Internet Explorer is not supported: the build ships ES2015 classes and arrow functions, and the styles use CSS custom properties.
Development Setup
yarn start- Start dev server- Open
index.htmllocated in the root folder, and start development. - Run
yarn lintbefore committing changes yarn test- Run the Playwright tests againstindex.html(runyarn playwright install chromiumonce first)- This project uses commitizen for conventional commit messages, use
yarn commitcommand instead ofgit commit
Links
관련 프로젝트 살펴보기
불러오는 중…