Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The fastest open-source data table for web.

License

NotificationsYou must be signed in to change notification settings

future-architect/cheetah-grid

Repository files navigation

GitHubnpmnpmnpmnpmnpmBuild Status

Cheetah Grid

The fastest open-source data table for web.

capture.png

DEMO & Documents

Downloading Cheetah Grid

Using Cheetah Grid with a CDN

npm

<scriptsrc="https://unpkg.com/cheetah-grid@2.1"></script>

Downloading Cheetah Grid using npm

npm

npm install -S cheetah-grid
import"cheetah-grid/main.css";import*ascheetahGridfrom"cheetah-grid";

Downloading Cheetah Grid source code

npm

main.mjs
main.css

Downloading Cheetah Grid using GitHub

GitHub package version

git clone

git clone https://github.com/future-architect/cheetah-grid.git

npm install & build

npm installnpm run build

built file is created in the./packages/cheetah-grid/dist directory

Usage

Example for basic usage

<divid="sample"style="height: 300px; border: solid 1px #ddd;"></div><script>// initializeconstgrid=newcheetahGrid.ListGrid({// Parent element on which to place the gridparentElement:document.querySelector("#sample"),// Header definitionheader:[{field:"check",caption:"",width:50,columnType:"check",action:"check",},{field:"personid",caption:"ID",width:100},{field:"fname",caption:"First Name",width:200},{field:"lname",caption:"Last Name",width:200},{field:"email",caption:"Email",width:250},],// Array data to be displayed on the grid    records,// Column fixed positionfrozenColCount:2,});</script>

Please refer to thedocuments for details

Using the Vue Component of Cheetah Grid
Please refer to thevue-cheetah-grid

Using the React Component of Cheetah Grid
Please refer to thereact-cheetah-grid

Definition of columns and headers

Theheader property, the property ofcheetahGrid.ListGrid, decides the behave and appearance of columns and header cells.We can set this property by constructor arguments or instance property.

Theheader property must be set by objects array (Array<object>).In the standard definition, each object consists of following properties.

PropertyDescription
captiondefine the header caption
fielddefine the field name or function of the record to display in the cell
width (optional)define the width of column
columnType (optional)define the type of column
style (optional)define the style of column
action (optional)define the action of column

To use multiple header, set the hierarchical structured Object to theheader property.

constgrid=newcheetahGrid.ListGrid({//...header:[//...{/* multiple header */caption:"Name",columns:[{field:"fname",caption:"First Name",width:200},{field:"lname",caption:"Last Name",width:200},],},//...],//...});

Definition of column type

Set the column type by usingcolumnType.

For example, you can set the following strings:

PropertyDescription
nonedraw text in the cell
'number'draw number in the cell with comma-separated
'check'draw checkbox in the cell
'button'draw button in the cell
'image'draw image in the cell
'multilinetext'draw multiline text in the cell

If you define a class instance you can define an advanced column types.

Please refer to thecolumn types documents for details

Definition of column action

Define column action by usingaction property.

actionDescription
'check'make the check box clickable.
'input'make the cell enterable.

If you define a class instance you can define an advanced column actions.

Please refer to thecolumn actions documents for details

Definition of column style

Define column style by usingstyle property.

Properties below are prepared in standard.

PropertyDescription
colordefine the color of cell.
textAligndefine the horizontal position of text in cell.
textBaselinedefine the vertical position of text in cell.
bgColordefine the background color of cell.
fontdefine the font of cell.
paddingdefine the padding of cell. if you set 4 values separately, please set theArray.
textOverflowdefine how to display when text overflows the area of a cell.clip orellipsis is available.

In addition, there is an extended style property for each column type.


Please refer to thedocuments for details

License

See theLICENSE file for license rights and limitations (MIT).

Supporting Cheetah Grid

sponsors

Sponsor this project

 

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp