File: src/elements/oreesh-table/oreesh-table.html
<script>
/**
An extension of the core-table
// Can be created dynamically
var table = new OreeshTable();
<!-- Or via HTML -->
<table is="oreesh-table" box-border show-hover>
<thead>
<tr>
<th is="oreesh-th" sortable>Stars</th>
<th is="oreesh-th">Lessons</th>
<th is="oreesh-th" sortable>Acievements</th>
<th is="oreesh-th" sortable>Completed</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>1-2 Variable Expressions </td>
<td>63%</td>
<td>Yes</td>
</tr>
<tr>
<td>2</td>
<td>1-3 Variable Expressions </td>
<td>13%</td>
<td>No</td>
</tr>
</tbody>
</table>
@class oreesh-table
**/
/**
Draws a distinct border around the perimeter of the table.
@attribute box-border
@type Boolean
**/
/**
Will style the table cells when they are hovered over.
@attribute show-hover
@type Boolean
**/
/**
A property applied to an `oreesh-th` `th` which allows the column to be sorted. A custom sort function can be assigned.
<th is="oreesh-th" sortable>Stars</th>
@attribute sortable
@type Boolean
**/
/**
A function which can be overwritten to give custom sorting.
// Customize the sort for the fourth column
$('table').find('th')[3].sortFunction = function(a, b) {
var options = ['No', 'Almost', 'Yes'];
if (options.indexOf(a) > options.indexOf(b)) {
return 1;
}
return -1;
};
@method sortFunction
**/
/**
Use custom sort, set custom sort map data.
@param {Object} custom sort map data
@method setCustomSortMap
**/
/**
A property applied to an `oreesh-th` `th` which allows the column to be sorted. A custom-sort map key can be assigned.
<th is="oreesh-th" custom-sort="testSort">Stars</th>
@attribute customSort
@type String
**/
/**
A property applied to an `oreesh-th` `th` which allows the column to be sorted. It is required when multiple table-header-row
<th is="oreesh-th" custom-index="0">Stars</th>
@attribute customIndex
@type String
**/
</script>
<dom-module id="oreesh-table">
<template>
<link rel="stylesheet" is="custom-style" href="./oreesh-table.css">
<content>
</content>
</template>
</dom-module>
<script src="./oreesh-table.js"></script>