ponysmith.github.io

tabletrimCallbacks

Callbacks

Callback functions can be defined as part of the Options object. For more details about the specific parameters and usage for the callbacks, keep reading.

.oninit()

Triggered when the tabletrim instance finishes initializing. The function passes a single parameter:

1
2
3
4
5
6
7
// Instantiate tabletrim with an onload() callback
var opts = {
    onload: function(table) {
        alert('tabletrim initialized');
    }
}
tabletrim($('#tabletrim-example'), opts);

.ontrim()

Triggered when the table has finished trimming. Passes a single parameter:

1
2
3
4
5
6
7
// Instantiate tabletrim with an ontrim() callback
var opts = {
    ontrim: function(table) {
        alert('table trimmed');
    }
}
tabletrim($('#tabletrim-example'), opts);

.onuntrim()

Triggered when the table has finished untrimming. Passes a single parameter:

1
2
3
4
5
6
7
// Instantiate tabletrim with an onuntrim() callback
var opts = {
    ontrim: function(table) {
        alert('table trimmed');
    }
}
tabletrim($('#tabletrim-example'), opts);

.onactivate()

Triggered when the selected column has been activated. Passes two parameters:

1
2
3
4
5
6
7
// Instantiate tabletrim with an onactivate() callback
var opts = {
    ontrim: function(table, column) {
        alert('column activated');
    }
}
tabletrim($('#tabletrim-example'), opts);

.ondeactivate()

Triggered when the selected column has been deactivated. Passes two parameters:

1
2
3
4
5
6
7
// Instantiate tabletrim with an ondeactivate() callback
var opts = {
    ontrim: function(table, column) {
        alert('column deactivated');
    }
}
tabletrim($('#tabletrim-example'), opts);