tabletabs plugin on jsFiddle
tabletabs plugin on jsFiddle
robertbrower
Posts: 158Questions: 1Answers: 0
I've been working on web apps for quite some time. Today I looked at jsFiddle for the first time. It's really cool. Have a look at this cool tabletabs plugin I put there. The tabletabs converts a single table element to jquery ui tabs based on the grouping text found in the table cell at the specified column index. The jsFiddle example also uses dataTables for that added kick.
jsFiddle: http://jsfiddle.net/atomofthought/Ms9ug/
Full page: http://jsfiddle.net/atomofthought/Ms9ug/embedded/result/
I hope someone finds this useful.
Robert
jsFiddle: http://jsfiddle.net/atomofthought/Ms9ug/
Full page: http://jsfiddle.net/atomofthought/Ms9ug/embedded/result/
I hope someone finds this useful.
Robert
This discussion has been closed.
Replies
Funny, I guess I am meant to make it now. ha
Regards,
Allan
The benefit of that approach is that when rows are added to the original table they are automatically 'put' in the correct tab.
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
return isMatch(currentTabName, aData);
});
where isMatch looks at some column in the data and returns true if its the same as the tab name.
now all you have to do is make sure to not show the 'tab name' column in the datatable, add some tabs that update the 'currentTabName' variable and filter the table when you click them