Convert Figma logo to code with AI

angular-ui logoui-grid

UI Grid: an Angular Data Grid

5,385
2,467
5,385
730

Top Related Projects

12,496

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

A lightning fast JavaScript grid/spreadsheet

JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

25,067

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

React components for efficiently rendering large lists and tabular data

Quick Overview

UI-Grid is a powerful data grid component for AngularJS applications. It provides features like sorting, filtering, and pagination, allowing developers to create complex and interactive tables with ease. The project aims to offer a flexible and customizable solution for displaying large datasets in web applications.

Pros

  • Highly customizable with numerous built-in features
  • Excellent performance for handling large datasets
  • Active community and regular updates
  • Extensive documentation and examples

Cons

  • Steep learning curve for advanced features
  • Can be overkill for simple table needs
  • Limited compatibility with newer Angular versions (2+)
  • Some users report occasional bugs and inconsistencies

Code Examples

  1. Basic grid setup:
$scope.gridOptions = {
  enableSorting: true,
  enableFiltering: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' },
    { field: 'company' }
  ],
  data: myData
};
  1. Custom cell template:
$scope.gridOptions.columnDefs = [
  {
    field: 'status',
    cellTemplate: '<div class="ui-grid-cell-contents">' +
                  '<span ng-if="row.entity.status === \'active\'" class="green-dot"></span>' +
                  '<span ng-if="row.entity.status === \'inactive\'" class="red-dot"></span>' +
                  '{{row.entity.status}}' +
                  '</div>'
  }
];
  1. Pagination:
$scope.gridOptions = {
  paginationPageSizes: [25, 50, 75],
  paginationPageSize: 25,
  enablePaginationControls: true
};

Getting Started

  1. Install UI-Grid using npm:

    npm install angular-ui-grid
    
  2. Include UI-Grid in your AngularJS module:

    angular.module('myApp', ['ui.grid']);
    
  3. Add the grid to your HTML:

    <div ui-grid="gridOptions" class="myGrid"></div>
    
  4. Define grid options in your controller:

    $scope.gridOptions = {
      columnDefs: [
        { field: 'name' },
        { field: 'age' }
      ],
      data: [
        { name: 'John', age: 25 },
        { name: 'Jane', age: 30 }
      ]
    };
    

Competitor Comparisons

12,496

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Pros of ag-grid

  • More feature-rich with advanced functionality like pivoting, grouping, and aggregation
  • Better performance for large datasets, handling millions of rows efficiently
  • Extensive documentation and active community support

Cons of ag-grid

  • Steeper learning curve due to its complexity and extensive API
  • Commercial license required for enterprise features, potentially increasing costs

Code Comparison

ui-grid:

<div ui-grid="gridOptions" class="myGrid"></div>

ag-grid:

<ag-grid-angular
    style="width: 100%; height: 100%;"
    class="ag-theme-alpine"
    [rowData]="rowData"
    [columnDefs]="columnDefs">
</ag-grid-angular>

Key Differences

  • ui-grid is specifically designed for AngularJS, while ag-grid supports multiple frameworks including Angular, React, and Vue
  • ag-grid offers more customization options and themes out of the box
  • ui-grid has a simpler API, making it easier to get started for basic use cases
  • ag-grid provides better export functionality, including Excel export with styling

Community and Maintenance

  • ui-grid has fewer recent updates and a smaller community compared to ag-grid
  • ag-grid is actively maintained with frequent releases and updates
  • Both projects have open-source versions, but ag-grid also offers a paid enterprise version with additional features

A lightning fast JavaScript grid/spreadsheet

Pros of SlickGrid

  • Lightweight and fast, especially for large datasets
  • More flexible and customizable
  • Framework-agnostic, can be used with various JavaScript libraries

Cons of SlickGrid

  • Less active development and community support
  • Steeper learning curve due to lower-level API
  • Fewer built-in features compared to ui-grid

Code Comparison

SlickGrid:

var grid = new Slick.Grid("#myGrid", data, columns, options);
grid.onCellChange.subscribe(function (e, args) {
  // Handle cell change
});

ui-grid:

$scope.gridOptions = {
  data: 'myData',
  columnDefs: [
    { field: 'name', displayName: 'Name' },
    { field: 'age', displayName: 'Age' }
  ]
};

SlickGrid offers more granular control over grid initialization and event handling, while ui-grid provides a more declarative approach with Angular-specific bindings. SlickGrid's API is lower-level, giving developers more flexibility but requiring more setup code. ui-grid, being built for Angular, integrates more seamlessly with Angular applications and offers a simpler configuration syntax.

JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

Pros of Handsontable

  • Framework-agnostic, can be used with various JavaScript libraries and frameworks
  • More extensive set of features, including advanced data manipulation and editing capabilities
  • Better performance with large datasets due to virtual rendering

Cons of Handsontable

  • Steeper learning curve due to more complex API and configuration options
  • Commercial license required for some features and use cases
  • Larger file size, which may impact initial load times

Code Comparison

UI-Grid:

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' }
  ],
  data: myData
};

Handsontable:

const hot = new Handsontable(container, {
  data: myData,
  columns: [
    { data: 'name' },
    { data: 'age', type: 'numeric' }
  ],
  columnSorting: true
});

Both libraries offer similar basic functionality for creating data grids. UI-Grid is specifically designed for AngularJS, while Handsontable provides a more flexible, framework-agnostic solution. UI-Grid's configuration is typically done through Angular's scope, whereas Handsontable uses a more traditional JavaScript object for initialization. Handsontable offers more advanced features out of the box, but may require additional setup for complex use cases.

25,067

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

Pros of Table

  • Framework-agnostic, supporting React, Vue, Solid, and more
  • More modern and actively maintained
  • Highly flexible and customizable with a modular architecture

Cons of Table

  • Steeper learning curve due to its flexibility and modular nature
  • Less out-of-the-box functionality compared to UI-Grid

Code Comparison

UI-Grid (AngularJS):

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' }
  ],
  data: myData
};

Table (React example):

const table = useReactTable({
  data: myData,
  columns: [
    { accessorKey: 'name', header: 'Name' },
    { accessorKey: 'age', header: 'Age' }
  ],
  getCoreRowModel: getCoreRowModel()
});

Summary

Table offers a more modern, flexible approach to data tables, supporting multiple frameworks and providing extensive customization options. However, it may require more setup and configuration compared to UI-Grid's more opinionated structure. UI-Grid, while older and specific to AngularJS, provides a more complete out-of-the-box solution with less initial configuration required.

React components for efficiently rendering large lists and tabular data

Pros of react-virtualized

  • More flexible and can be used for various virtualized components beyond grids
  • Better performance for large datasets due to efficient rendering
  • Easier integration with React ecosystem and state management

Cons of react-virtualized

  • Steeper learning curve for complex implementations
  • Less out-of-the-box features compared to ui-grid
  • Requires more custom code for advanced grid functionalities

Code Comparison

ui-grid:

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'age', type: 'number' }
  ],
  data: myData
};

react-virtualized:

<Grid
  cellRenderer={({ columnIndex, key, rowIndex, style }) => (
    <div key={key} style={style}>
      {list[rowIndex][columnIndex]}
    </div>
  )}
  columnCount={columnCount}
  columnWidth={100}
  height={300}
  rowCount={rowCount}
  rowHeight={30}
  width={300}
/>

Summary

ui-grid is a feature-rich Angular-based grid solution with a gentler learning curve, while react-virtualized offers more flexibility and better performance for large datasets in React applications. The choice between them depends on the specific project requirements, framework preference, and desired level of customization.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

UI-Grid : An AngularJS data grid

Coverage Status FOSSA Status npm OpenCollective OpenCollective Gitter

Help!

Head to http://ui-grid.info for documentation and tutorials. Join https://gitter.im/angular-ui/ui-grid to discuss development and ask for specific help.

We're always looking for new contributors, for pro-level contribution guidelines look at Contributor.md, if you're more of a first-timer with open source (or just need a refresher), look at First Time Open Source Contributor.md, also look at Developer.md

Need Some Inspiration? Have a look at our open good first issue issues, or the help wanted issues if you are looking for more of a challenge

Installing

Bower

    bower install angular-ui-grid
    <link rel="stylesheet" type="text/css" href="bower_components/angular-ui-grid/ui-grid.min.css">
<script src="bower_components/angular-ui-grid/ui-grid.min.js"></script>

NPM

    npm install angular-ui-grid
    <link rel="stylesheet" type="text/css" href="node_modules/angular-ui-grid/ui-grid.min.css">
    <script src="node_modules/angular-ui-grid/ui-grid.min.js">

CDN

You can use jsdelivr.com's cdn url to access the files. Just alter the version as you need.

Angular Compatibility

UI-Grid is currently compatible with Angular versions ranging from 1.4.x to 1.8.x.

Feature Stability

UI-Grid comes bundled with several features. Not all of them are currently stable. See the list below for the stability of each:

FeatureRelease state
auto-resize-grid (API)beta
cellnav (API)stable
edit (API)stable
expandable (API)alpha
exporter (API)stable
grouping (API)beta
importer (API)stable
infinite-scroll (API)beta
move-columns (API)alpha
pagination (API)alpha
pinning (API)stable
resize-columns (API)stable
row-edit (API)stable
saveState (API)stable
selection (API)stable
tree-base (API)beta
tree-view (API)beta

For more details on the features check the Tutorials.

Plugins

UI-Grid has an excellent plugin system. Most new features can be added as plugins. Please see some discussion of that in the Developer guidelines. There is a list of known plugins on the tutorial site. If you would like your plugin added to that list, please edit the tutorial page and send a pull request.

Building

The first step is to install dependencies. git is required and must be available from the command line. If you don't have it, install git and ensure that the executable is in your path. If you are new to git, the easiest way to install is by installing the github client.

The grunt command line utility is also required.

# If you don't already have the grunt-cli installed:
> npm install -g grunt-cli

With git and grunt-cli installed you simply run the following commands to install all dependencies.

> npm install
> grunt install

The default grunt task will test and build files into dist/

> grunt

Developing

Development "watch" task. This will automatically rebuild from source on changes, reload Gruntfile.js if you change it, and rebuild the docs.

  1. A server on localhost:9002 serving whichever directory you checked out, with livereload. Navigate to http://localhost:9002/misc/demo to see the demo files.
  2. A server on localhost:9003 serving the ./docs directory. These are the docs built from source with grunt-uidocs-generator.

grunt dev

By default grunt dev will start several karma background watchers that will run the tests against multiple versions of angular. You may specify the version(s) you want to use with the --angular flag:

> grunt dev --angular=1.6.7

> grunt dev --angular=1.5.11,1.6.7

You can also use the --browsers specify what browsers to test with (ChromeHeadless is the default).

> grunt dev --browsers=Chrome

# Run a single test run against multiple browsers
> grunt karma:single --browsers=Chrome,Firefox,IE

By default the dev tasks runs e2e tests with protractor. If you have problems with them running slow or hanging, you can disable them with the --no-e2e flag:

> grunt dev --no-e2e

The grunt task is getting slower as the body of tests gets larger. If you're only working on the core functionality you can disable the unit tests on the features with the --core flag:

> grunt dev --core

As a shortcut for options that the developers frequently use, there is also a --fast flag, which equates to --core --no-e2e --angular=<latest>:

> grunt dev --fast

Karmangular

The karmangular task runs tests serially against multiple browsers (it is used internally by the dev task).

# Run tests against all available versions of Angular on Chrome
> grunt karmangular --browsers=Chrome

# Run tests with a couple versions of Angular against the default ChromeHeadless browser
> grunt karmangular --angular=1.5.11,1.6.7

SauceLabs

ui-grid is set up to run against SauceLabs. You must have the SAUCE_ACCESS_KEY environment variable set.

# Execute tests for a couple versions of angular on IE8
> grunt karmangular --angular=1.5.11,1.6.7 --browsers=SL_IE_8

# Run the watch tasks against IE10
> grunt dev --browsers=SL_IE10

The full list of SauceLabs browsers can be seen by running grunt saucebrowsers. Usually it should suffice to let Travis do this testing automatically, unless you're trying to debug a browser-specific issue.

What Happened to 2.x?

As of the 3.0 release, 2.x is officially deprecated. There will be no further releases. If for some reason you need to find the 2.x source please see the 2.x branch.

The 2.x docs are here: https://github.com/angular-ui/ng-grid-legacy/wiki.

Repository Rename

With the 3.0 release, the repository has been renamed from "ng-grid" to "ui-grid".

All network traffic to GitHub should redirect automatically but they say you should update your git remote url:

git remote set-url origin https://github.com/angular-ui/ui-grid.git

Thanks

Thanks to Sauce Labs and BrowserStack for providing their testing platforms to open source projects for free.

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

Sponsors

Become a sponsor and get your logo on our website and on our README on Github with a link to your site. [Become a sponsor]

NPM DownloadsLast 30 Days