Table Parser for WET 3.0 - nschonni/wet-boew GitHub Wiki

Table of Contents

Overview

Project Lead: Pierre Dubois (@duboisp) - Industry Canada, Canadian Intellectual Property Office

Purpose

Create a plugin that use a table

Developing for WET with the table parser

How to parse the table

  1. Load the dependency "parserTable"
  2. call the parser with your jQuery table element
if (!$(elem).data().tblparser) { _pe.fn.parsertable.parse($(elem)); }

How to Access to the parsed data

That is simple, once the table are fully parsed, each tabular element get a new jQuery.Data attribute called "tblparser". You can access it like this

tblparser = $(elem).data().tblparser;

the "tblparser" object would depend of the "elem". You can use the API Interface to know the relationship and get the attribute available.

If you want, you can access it directly from the Firebox console, something like this

console.log($('table:eq(0)').data().tblparser);

API Interface

On my Table Usability Concept github project you will find the full API listed here https://github.com/duboisp/Table-Usability-Concept/tree/master/API You will need to use the API under "Table Parser - WET 3.0 release" header.

If you have any question regarding the API or about the Table Usability Concept, don't hesitate to submit an issue (https://github.com/duboisp/Table-Usability-Concept/issues/new)

Example of use

If you are looking about how to get access to the parsed tabular data take a look at

HTML Table Validator

Zebra Stripping Chart and Graph
  • From Line 2384 - https://github.com/wet-boew/wet-boew/blob/master/src/js/dependencies/charts.js#L2384
  • To Line 2424 - https://github.com/wet-boew/wet-boew/blob/master/src/js/dependencies/charts.js#L2424
⚠️ **GitHub.com Fallback** ⚠️