Configuring the Table

You can make the table configurable by a button in the statusbar.

  • var popup = ts.ui.Notification;
    ts.ui.get('#table1', table => {
    	table.configbutton(function onclick() {
    		popup.success('Go configure!');
    	}).cols(['A', 'B', 'C', 'D']).rows([
    		[1, 4, 7, 10],
    		[2, 5, 8, 11],
    		[3, 6, 9, 12]
    	]);
    });
    

The button triggers a callback, but there is otherwise no default UI associated. Since the visibility of columns is always a candidate for configuration, the ColModel supports a visible property that can be used to hide columns.

ts.ui.get('#table1', table => {
	var cols = table.cols();
	(function hide(index) {
		cols[index].visible = false;
		if(index) {
			setTimeout(function next() {
				hide(--index);
			}, 1000);
		}
	}(3));
});

Here's a summary of these things.