Default Datatable
This shows the default ui styles and behavior when using the Invision UI datatable.
This example demonstrates how to use the datatable component to present a collection of JSON data.
This datatable has a Custom Header Cell Template applied to it, which adds a cog icon to each header cell that is visible on mouse-hover.
This datatable also has a Custom Header Template applied to it, which adds a cog element to the top-right corner.
You will find code in the controller (datatable.example.controller.js) that wires up a click-handler to each header cell cog. In this example, clicking a header cell cog prints a message to the log.
To turn on auto column resize feature, use the attribute directive inv-grid-autosize-column
- HTML
<p> This example demonstrates how to use the datatable component to present a collection of JSON data. </p> <p> This datatable has a Custom Header Cell Template applied to it, which adds a cog icon to each header cell that is visible on mouse-hover. </p> <p> This datatable also has a Custom Header Template applied to it, which adds a cog element to the top-right corner. </p> <p> You will find code in the controller (datatable.example.controller.js) that wires up a click-handler to each header cell cog. In this example, clicking a header cell cog prints a message to the log. </p> <p> To turn on auto column resize feature, use the attribute directive <code>inv-grid-autosize-column</code> </p> <div ng-controller="datatableExampleController" class="t-content"> <div class="s-datatable c-datatable" ui-grid-resize-columns inv-grid-autosize-column ui-grid="{ data: datatable.tableData, onRegisterApi: datatable.init, columnDefs: datatable.columnsWithDefaultSizing }"></div> </div>