diff options
author | terminaldweller <thabogre@gmail.com> | 2022-07-21 05:36:02 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-07-21 05:36:02 +0000 |
commit | 85db7c5287ae58efc108263f7a40bdbd02de1a82 (patch) | |
tree | 8292d90db8999dabc2e3872ea75547cb7fcf0c2d /dbdocs/routines.js | |
parent | changed the max doc size to 40K characters.255 was not enough... (diff) | |
download | mdrtl-85db7c5287ae58efc108263f7a40bdbd02de1a82.tar.gz mdrtl-85db7c5287ae58efc108263f7a40bdbd02de1a82.zip |
added docs for the db using schemaspy
Diffstat (limited to 'dbdocs/routines.js')
-rw-r--r-- | dbdocs/routines.js | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/dbdocs/routines.js b/dbdocs/routines.js new file mode 100644 index 0000000..cdc2350 --- /dev/null +++ b/dbdocs/routines.js @@ -0,0 +1,70 @@ +var filterBy = function(functionType) { + $.fn.dataTableExt.afnFiltering.length = 0; + $.fn.dataTable.ext.search.push( + function( settings, data, dataIndex ) { + var type = data[1]; // use data for the Type column + + if ( type.toUpperCase() == functionType || functionType == 'All' ) + { + return true; + } + return false; + } + ); +} + +$(document).ready(function() { + var activeObject; + var table = $('#routine_table').DataTable( { + lengthChange: false, + ordering: true, + paging: config.pagination, + pageLength: 50, + autoWidth: true, + processing: true, + order: [[ 0, "asc" ]], + buttons: [ + { + text: 'All', + action: function ( e, dt, node, config ) { + filterBy('All'); + if (activeObject != null) { + activeObject.active(false); + } + table.draw(); + } + }, + { + text: 'Functions', + action: function ( e, dt, node, config ) { + filterBy('FUNCTION'); + if (activeObject != null) { + activeObject.active(false); + } + this.active( !this.active() ); + activeObject = this; + table.draw(); + } + }, + { + text: 'Procedures', + action: function ( e, dt, node, config ) { + filterBy('PROCEDURE'); + if (activeObject != null) { + activeObject.active(false); + } + this.active( !this.active() ); + activeObject = this; + table.draw(); + } + }, + { + extend: 'columnsToggle', + columns: '.toggle' + } + ] + } ); + + //schemaSpy.js + dataTableExportButtons(table); +} ); |