@@ -, +, @@ --- koha-tmpl/opac-tmpl/bootstrap/js/datatables.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js +++ a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js @@ -144,7 +144,17 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { (function($) { - $.fn.api = function(options, columns_settings, add_filters) { + /** + * Create a new dataTables instance that uses the Koha RESTful API's as a data source + * @param {Object} options Please see the dataTables documentation for further details + * We extend the options set with the `criteria` key which allows + * the developer to select the match type to be applied during searches + * Valid keys are: `contains`, `starts_with`, `ends_with` and `exact` + * @param {Object} column_settings The arrayref as returned by TableSettings.GetColums function available + * from the columns_settings template toolkit include + * @return {Object} The dataTables instance + */ + $.fn.kohaTable = function(options, columns_settings) { var settings = null; if(options) { if(!options.criteria || ['contains', 'starts_with', 'ends_with', 'exact'].indexOf(options.criteria.toLowerCase()) === -1) options.criteria = 'contains'; @@ -270,7 +280,7 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { return newnode.text().replace( /\n/g, ' ' ).trim(); } - }; + } var export_buttons = [ { --