Table buttons

The Table supports buttons and we will soon add some futher documentation. For now we will simply recommend that you don't use buttons unless the Table is maximized. This feature however also doesn't have any documentation 😢

  • var table = ts.ui.get('#table1');
    table.cols(['One', 'Two', 'Three']).rows([
    	['A', 'B', 'C'],
    	['D', 'E', 'F'],
    	['G', 'H', 'I'],
    ]).buttons([
    	{ label: 'One', type: 'ts-primary' },
    	{ label: 'Two', type: 'ts-secondary' },
    	{ label: 'Three', onclick: () => {
    		console.log('The tertiary button was clicked!');
    	}}
    ]);

The buttons method both sets and gets the buttons. If you omit the argument, you"ll get the current actions (jQuery style). You can use array methods like push, pop, shift, unshift, splice and so on to manage buttons, just note that the buttons length is a readonly property.

TODO: The Table breakpoint should be local to the Table (not the window) :/