Docs: accordion active tab refreshes widgets. See build table widget

This commit is contained in:
Mottie 2014-04-23 17:51:49 -05:00
parent b68abf09c1
commit f24f15e10c
3 changed files with 16 additions and 0 deletions

View File

@ -306,6 +306,7 @@
$('#array2Table').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions : {
// build_type : 'array', // can sometimes be detected if undefined
build_source : arry,
@ -349,6 +350,7 @@
<pre class="prettyprint lang-js">$(function() {
$('#string2Table').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
build_type : 'array',
build_source : 'header 1,header 2,header 3;r1c1,r1c2,r1c3;r2c1,r2c2,r2c3;r3c1,r3c2,r3c3;"footer, 1","footer, 2","footer, 3"',
@ -430,6 +432,7 @@
<pre class="prettyprint lang-js">$(function() {
$('#csv2Table').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
// *** build widget core ***
build_type : 'csv',
@ -495,6 +498,7 @@ Album,Artist,Price ($)</pre>
<pre class="prettyprint lang-js">$(function() {
$('#csv2Table2').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
// *** build widget core ***
build_type : 'csv',
@ -664,6 +668,7 @@ Album,Artist,Price ($)</pre>
$('#object2Table').tablesorter({
theme: 'blue',
widgets: ['zebra'],
data : dataObject, // same as using build_source (build_source would override this)
widgetOptions : {
// *** build object options ***
@ -740,6 +745,7 @@ Album,Artist,Price ($)</pre>
<pre class="prettyprint lang-js">$(function() {
$('#object2Table2').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
build_type : 'json',
build_source : { url: 'assets/build.json', dataType: 'json' }

View File

@ -17,6 +17,7 @@ $(function(){
$('#array2Table').tablesorter({
theme: 'blue',
data : arry,
widgets: ['zebra'],
widgetOptions : {
// build_type : 'array', // can be detected if undefined
// build_source : arry, // overrides the data setting above
@ -34,6 +35,7 @@ $(function(){
// ***************************
$('#string2Table').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
build_type : 'array',
build_source : 'header 1,header 2,header 3;r1c1,r1c2,r1c3;r2c1,r2c2,r2c3;r3c1,r3c2,r3c3;"footer, 1","footer, 2","footer, 3"',
@ -53,6 +55,7 @@ $(function(){
// ***************************
$('#csv2Table').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
// *** build widget core ***
build_type : 'csv', // array, object, csv, ajax
@ -87,6 +90,7 @@ $(function(){
// ***************************
$('#csv2Table2').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
// *** build widget core ***
build_type : 'csv',
@ -146,6 +150,7 @@ $(function(){
$('#object2Table').tablesorter({
theme: 'blue',
data : dataObject,
widgets: ['zebra'],
widgetOptions : {
// *** build object options ***
build_objectRowKey : 'rows', // object key containing table rows
@ -160,6 +165,7 @@ $(function(){
// ***************************
$('#object2Table2').tablesorter({
theme: 'blue',
widgets: ['zebra'],
widgetOptions: {
build_type : 'json',
build_source : { url: 'assets/build.json', dataType: 'json' }

View File

@ -123,6 +123,10 @@
$this.find('.accordion-link').click(function(){
$this.accordion( "option", "active", $(this).data('index') );
});
},
activate: function(e, ui) {
// refresh zebra widget when rows are visible
ui.newPanel.find('table').trigger('applyWidgets');
}
});
// open parent of nested accordion