$(document).ready(function () { $('#pluginAppObj_189_05_jtable').jtable({ title: 'Downloads', paging: true, pageSize: 30, pageSizeChangeArea: false, sorting: true, actions: { listAction: 'pluginAppObj_189_05/dbviewer.php?action=list', }, fields: { 'key': { key: true, create: true, edit: false, list: true, title: 'key', }, 'user_id': { key: false, create: true, edit: true, list: true, title: 'user_id', }, 'ip_address': { key: false, create: true, edit: true, list: true, title: 'ip_address', }, 'geo_location': { key: false, create: true, edit: true, list: true, title: 'geo_location', }, 'file_name': { key: false, create: true, edit: true, list: true, title: 'file_name', }, 'size_mb': { key: false, create: true, edit: true, list: true, title: 'size_mb', }, 't_stamp': { key: false, create: true, edit: true, list: true, title: 't_stamp', }, }, formCreated : function(event, data) { if(data.formType == 'error') return; var div = data.form[0].parentElement; if(data.formType != 'delete') div = div.parentElement; $(div).addClass('pluginAppObj_189_05_dialog'); }, messages: { serverCommunicationError: 'An error occured while communicating to the server.', loadingMessage: 'Loading records...', noDataAvailable: 'No data available!', addNewRecord: 'Add new record', editRecord: 'Edit Record', areYouSure: 'Are you sure?', deleteConfirmation: 'This record will be deleted. Are you sure?', save: 'Save', saving: 'Saving', cancel: 'Cancel', deleteText: 'Delete', deleting: 'Deleting', error: 'Error', close: 'Close', cannotLoadOptionsFor: 'Can not load options for field {0}', pagingInfo: 'Showing {0}-{1} of {2}', pageSizeChangeLabel: 'Row count', gotoPageLabel: 'Go to page', canNotDeletedRecords: 'Can not deleted {0} of {1} records!', deleteProggress: 'Deleted {0} of {1} records, processing...' } }); $('#pluginAppObj_189_05_filter_button').click(function (e) { e.preventDefault(); var filter = $('#pluginAppObj_189_05_filter_field').val(); if(filter == undefined || filter == ""){ var params = {}; } else{ var params = {filter : filter}; } $('#pluginAppObj_189_05_jtable').jtable('load', params); }); $('#pluginAppObj_189_05_csv_button').click(function (e) { e.preventDefault(); var filter = $('#pluginAppObj_189_05_filter_field').val(); if(filter == undefined || filter == ""){ filter = ''; } else{ filter = '&filter=' + filter; } location.href = 'pluginAppObj_189_05/dbviewer.php?action=export' + filter; }); $('#pluginAppObj_189_05_jtable').jtable('load'); });