For a live demo of this predix UI component, visit
arongraham-ge Merge pull request #213 from predixdesignsystem/update-datagrid-comment
Updated style and message for px-data-table and px-data-grid reference
Latest commit e3f66fd Dec 1, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github changing ISSUES message to be more clear Dec 8, 2016
css prepare branch for release Dec 1, 2018
demo update indentation for style Dec 1, 2018
docs Updating documentation Oct 19, 2017
sass Move to Apache-2.0 license Apr 30, 2018
test Downgraded px-dropdown for Polymer 1 support, fixed broken unit tests. Aug 29, 2018
.bowerrc Passing unit tests (with IE11 inconsistent with 1 test) Oct 18, 2017
.editorconfig First commit Sep 24, 2015
.gitignore Responding to PR comments and updating remote-data tests to same patt… Oct 19, 2017
.jshintrc Gulp experiment & style modules. Aug 3, 2016
.travis.yml Chnages to get tests passing on master branch Oct 21, 2018
CONTRIBUTING.md added CONTRIBUTING.md doc. Jun 6, 2016
HISTORY.md Updating the version based on recent fixes. Oct 17, 2018
LICENSE Move to Apache-2.0 license Apr 30, 2018
OSS_Notice.pdf new license file Aug 30, 2016
README.md Update PredixDev references to predixdesignsystem Oct 22, 2018
aha-table.html Merge pull request #209 from AnweshCR7/issue-130-page-revert Aug 29, 2018
bower.json prepare branch for release Dec 1, 2018
contacts-mini.json Added new demo pages Aug 18, 2016
contacts.json First commit Sep 24, 2015
demo-angular.html Move to Apache-2.0 license Apr 30, 2018
demo.html Move to Apache-2.0 license Apr 30, 2018
deploy.enc Add new Travis deploy credentials Dec 21, 2016
favicon.ico Added sub-component demos - work in progress Aug 4, 2016
gulpfile.js Update gulpfile May 11, 2018
index.html Move to Apache-2.0 license Apr 30, 2018
monogram-wdmk.png Fixup merge helpers in json file. Jul 22, 2016
package-lock.json prepare branch for release Dec 1, 2018
package.json prepare branch for release Dec 1, 2018
preventAutoSynch.md updated README with prevent auto synch instructions Mar 11, 2016
px-data-table-cell.html Move to Apache-2.0 license Apr 30, 2018
px-data-table-column.html Move to Apache-2.0 license Apr 30, 2018
px-data-table-highlight.html Move to Apache-2.0 license Apr 30, 2018
px-data-table.html Move to Apache-2.0 license Apr 30, 2018
px-edit-cell.html Move to Apache-2.0 license Apr 30, 2018
px-example-highlight.html Move to Apache-2.0 license Apr 30, 2018
px-pagination.html Move to Apache-2.0 license Apr 30, 2018
wct.conf.json remove safari 11 Oct 21, 2018
yarn.lock Chnages to get tests passing on master branch Oct 21, 2018

README.md

px-data-table Build Status

Overview

Px-data-table is a Predix UI component which defines a data table, optionally using a sub-element for advanced column settings.

Usage

Prerequisites

  1. node.js
  2. npm
  3. bower
  4. webcomponents-lite.js polyfill

Node, npm and bower are necessary to install the component and dependencies. webcomponents.js adds support for web components and custom elements to your application.

Getting Started

First, install the component via bower on the command line.

bower install https://github.com/predixdesignsystem​/px-data-table.git --save

Second, import the component to your application with the following tag in your head.

<link rel="import" href="bower_components/px-data-table/px-data-table.html"/>

Finally, use the component in your application:

Minimum - Client-Side Sort/Filter/Pagination:

    <px-data-table
      table-data="{{data}}"
      >
    </px-data-table>

Minimum - Server-Side Sort/Filter/Pagination:

    <px-data-table
      total-entries="100"
      first-item-index="11"
      table-data="{{dataSubset}}"
      remote-data="true"
      >
    </px-data-table>

Client-Side VS Server-Side Data Paradigms

There are two main paradigms for the source of data in a table.

In a Client-Side model, the browser makes one request for the complete set of data. This means that sorting, filtering, and pagination all happen in memory on the client. While this produces snappy tables with reasonably sized data sets, it can lead to a sluggish UI for larger data sets. This works great with data sets that don't change frequently, since the full payload would have to be resent for every update.

In a Server-Side model, the browser makes a request for a subset of data for a particular page. Sorting, filtering, and pagination requests will have to be made to a service for a new subset of data that matches the user's intended criteria. This prevents the browser from being overwhelmed with excessively large data sets by only exposing one page's worth of data at a time. This is ideal for larger data sets or where it is preferable to make multiple small requests instead of fewer larger requests. Due to the increased frequency of requests, the UI is more likely to display data in sync with the server.

Client Side Sort/Filter/Pagination

For more details and complex examples: Client-Side Data Reference

Server Side Sort/Filter/Pagination

For more details and complex examples: Server-Side Data Reference

Integrating with other frameworks (ex: Angular):

You may not be able to use 2-way binding with the objects/arrays in other frameworks such as Angular.

We suggest instead to use events and selectors, for example:

document.getElementById("myDataTable").addEventListener("px-row-click", function(e) {
    ...
});

document.getElementById("myDataTable").addEventListener("px-select-all-click", function(e) {
    ...
});

$scope.doSomethingWithSelectedRows = function() {
    $scope.allSelectedRows = document.getElementById("myDataTable").selectedRows;
};

You may also want to prevent your data from auto-synching with your model. If so, we've written up a [little explanation] to help you with that.

Documentation

Read the full API and view the demo here.

Local Development

From the component's directory...

$ npm install
$ bower install
$ gulp sass

From the component's directory, to start a local server run:

$ gulp serve

The root of that server (e.g. http://localhost:8080/) will automatically open in your default browser with the API documentation page and interactive working examples.

gulp serve also runs gulp watch concurrently so that when you make a change to your source files and save them, your preview will be updated in any browsers you have opened and turned on in LiveReload.

GE Coding Style Guide

GE JS Developer's Guide

Known Issues

Please use Github Issues to submit any bugs you might find.