@generic-ui/ngx-grid

中文文档
0.21.0发布于 2023/11/12MITTypeScriptES Module近 30 天下载 2557

Generic UI - Angular Grid library

原始使用文档
文档目录9 节
  1. Grid component
  2. Quick Example
  3. Setup template
  4. Specify columns and source
  5. Include GuiGridModule
  6. Installation
  7. Grid API
  8. Contact
  9. License:

Generic UI - Grid for Angular

Grid component

Generic UI Grid is one of the best free angular grid library. It offers many built-in features that work out of the box: editing, sorting, pagination, theming, summaries, column configuration, and many more. Performance is the main focus point, grid is able to present huge sets of data up to 1 000 000 rows. It greatly integrates with the best javascript framework there is Angular. All of that makes this library a great free to use Angular data table plugin.

demo

Quick Example

Generic UI is easy to use, all you need to do is specify columns and source. Below is simple use of our grid with three columns and three items.

demo

The creation of an gui-grid will be done in these simple steps:

Setup template

Specify columns and source in grid component Include GuiGridModule Setup template Add code below to you html template. Notice that <gui-grid> has two input [columns] and [source]. These will help you specify the shape of the grid and the data you wish to bind.

app.component.html:

<gui-grid [columns]="columns"
      [source]="source">
</gui-grid>

Specify columns and source

Now write a variable inside app.component.ts named as columns, with it we will create column headers. In this example we are using two attributes:

  • header represents displayed header name,
  • field binds data from source.

You can find more column options in a columns section

app.component.ts:

columns: Array<GuiColumn> = [{
    header: 'Name',
    field: 'name'
}, {
    header: 'Type',
    field: 'type'
}, {
    header: 'Price',
    field: 'price'
}];

We got columns specified, now we need to bind it with source. Create new variable called source in app.component.ts and copy code below. Inside source are three items each has three values: name, type, price. These values are names of our columns fields.

app.component.ts

source: Array<any> = [{
    name: 'T-shirt',
    type: 'clothes',
    price: '15$'
}, {
    name: 'Shoes',
    type: 'footwear',
    price: '100$'
}, {
    name: 'Ball cap',
    type: 'headgear',
    price: '50$'
}];

Include GuiGridModule

The only thing that is left is to include GridModule in app.module.ts and we are done.

app.module.ts

import { GuiGridModule } from '@generic-ui/ngx-grid';

@NgModule({
    imports: [
        GuiGridModule
    ]
})
export class BasicModule {
}

Installation

First you need to install @generic-ui/ngx-grid package with all it's peer dependencies.

Npm installation:

npm install @generic-ui/ngx-grid [email protected]

Yarn installation:

yarn add @generic-ui/ngx-grid [email protected]

Make sure that you use Angular in version at least 6.1.10 and Rxjs in version greater than 6.0.0.

Grid API

In this section you can find list of Inputs and Outputs that configures gui-grid.

In order to build the grid you need to have data source specified and defined columns. Source and columns need to work together, therefor columns have to be bound with data source. The basic section got an easy guide how to do it.

Generic UI is completely editable. You can specify:

  • width and height,
  • different theme like: Fabric, Material, Light, Dark,
  • header placed at the top and/or bottom of the grid,
  • disabled or enabled vertical and horizontal lines,
  • rows color,
  • loading indicator.

Generic UI also provides the output options that posts information anytime when:

  • page changes,
  • page size changes,
  • grid row is selected.

Contact

Feel free to contact us with any questions or issues, as FAQ will be published in the near future. We will really appreciate it you letting us know how do you use this angular grid library. If you find any bug, let us know about it through Report an issue.

License:

Code released under the MIT license.

版本与发布记录

@generic-ui/ngx-grid 共发布 66 个版本,首次发布于 2019/06/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.21.0latest2023/11/123 年前
0.20.02023/11/103 年前
0.19.12023/11/093 年前
0.19.02022/12/023 年前
0.18.12022/07/184 年前
0.18.02022/06/294 年前

关于 @generic-ui/ngx-grid 的常见问题

@generic-ui/ngx-grid 是什么?

Generic UI - Angular Grid library

如何安装 @generic-ui/ngx-grid?

在项目目录运行 npm install @generic-ui/ngx-grid,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@angular/common(^17.0.0)、@angular/core(^17.0.0)、@angular/forms(^17.0.0)、@angular/platform-browser(^17.0.0)、@generic-ui/fabric(0.21.0)、@generic-ui/hermes(0.21.0)、rxjs(~7.8.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@generic-ui/ngx-grid 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@generic-ui/ngx-grid 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@generic-ui/ngx-grid 可以商用吗?

@generic-ui/ngx-grid 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@generic-ui/ngx-grid 的下载量有多少?

根据 npm 官方下载统计,@generic-ui/ngx-grid 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,557 次,日均约 85 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@generic-ui/ngx-grid 还在维护吗?

最新版本 0.21.0 发布于 2023/11/12(3 年前);至今共发布 66 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/06/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。