$(document).ready(function () { $('#pluginAppObj_196_06_jtable').jtable({ title: 'Vicentini caduti o dispersi in Russia', paging: true, pageSize: 30, pageSizeChangeArea: false, sorting: true, actions: { listAction: 'pluginAppObj_196_06/dbviewer.php?action=list', }, fields: { 'ID': { key: true, create: false, edit: false, list: false, title: 'ID', }, 'NUM': { key: false, create: true, edit: true, list: true, title: 'NUM', }, 'COGNOME': { key: false, create: true, edit: true, list: true, title: 'COGNOME', }, 'NOME': { key: false, create: true, edit: true, list: true, title: 'NOME', }, 'TIPO_CAD': { key: false, create: true, edit: true, list: true, title: 'TIPO_CAD', }, 'DATA_NASC': { key: false, create: true, edit: true, list: true, title: 'DATA_NASC', type: 'date' }, 'LUOGO_NASC': { key: false, create: true, edit: true, list: true, title: 'LUOGO_NASC', }, 'PROV_NASC': { key: false, create: false, edit: false, list: false, title: 'PROV_NASC', }, 'COD_GRADO': { key: false, create: true, edit: true, list: true, title: 'COD_GRADO', }, 'DIVISIONE': { key: false, create: true, edit: true, list: true, title: 'DIVISIONE', }, 'CORPO': { key: false, create: true, edit: true, list: true, title: 'CORPO', }, 'BATTAGLIONE': { key: false, create: true, edit: true, list: true, title: 'BATTAGLIONE', }, 'NOTE': { key: false, create: false, edit: false, list: false, title: 'NOTE', }, 'DECORAZIONI': { key: false, create: false, edit: false, list: false, title: 'DECORAZIONI', }, 'FOTO': { key: false, create: false, edit: false, list: false, title: 'FOTO', }, 'DATA_MORTE': { key: false, create: true, edit: true, list: true, title: 'DATA_MORTE', type: 'date' }, 'LUOGO_MORTE': { key: false, create: true, edit: true, list: true, title: 'LUOGO_MORTE', }, }, 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_196_06_dialog'); }, messages: { serverCommunicationError: 'Si è verificato un errore di comunicazione con il server.', loadingMessage: 'Caricamento dei record...', noDataAvailable: 'Non ci sono dati disponibili!', addNewRecord: 'Crea un nuovo record', editRecord: 'Modifica record', areYouSure: 'Sei sicuro?', deleteConfirmation: 'Il record verrà eliminato. Sei sicuro?', save: 'Salva', saving: 'Salvataggio', cancel: 'Annulla', deleteText: 'Elimina', deleting: 'Eliminazione', error: 'Errore', close: 'Chiudi', cannotLoadOptionsFor: 'Opzioni non disponibili per il campo {0}', pagingInfo: 'Record {0}-{1} su {2}', pageSizeChangeLabel: 'Righe per pagina', gotoPageLabel: 'Vai alla pagina', canNotDeletedRecords: 'Impossibile eliminare il record {0} di {1}!', deleteProggress: 'Eliminazione di {0} di {1} record in corso...' } }); $('#pluginAppObj_196_06_filter_button').click(function (e) { e.preventDefault(); var filter = $('#pluginAppObj_196_06_filter_field').val(); if(filter == undefined || filter == ""){ var params = {}; } else{ var params = {filter : filter}; } $('#pluginAppObj_196_06_jtable').jtable('load', params); }); $('#pluginAppObj_196_06_csv_button').click(function (e) { e.preventDefault(); var filter = $('#pluginAppObj_196_06_filter_field').val(); if(filter == undefined || filter == ""){ filter = ''; } else{ filter = '&filter=' + filter; } location.href = 'pluginAppObj_196_06/dbviewer.php?action=export' + filter; }); $('#pluginAppObj_196_06_jtable').jtable('load'); });