diff -r 89b7449d1fd9 -r 3ce3df681be0 www/js/inv_miscs.js --- a/www/js/inv_miscs.js Thu Jun 11 19:59:30 2020 +0200 +++ b/www/js/inv_miscs.js Sat Jun 13 12:14:26 2020 +0200 @@ -3,6 +3,8 @@ * * Michiel Broek * + * This file is part of Brewery Management System + * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any @@ -95,9 +97,7 @@ commit(true); location.reload(true); }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } + error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); }, addrow: function(rowid, rowdata, position, commit) { @@ -112,9 +112,7 @@ commit(true); location.reload(true); }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } + error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); }, updaterow: function(rowid, rowdata, commit) { @@ -129,9 +127,7 @@ commit(true); location.reload(true); }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } + error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); } }, @@ -169,6 +165,9 @@ $('#tht_date').jqxDateTimeInput(Dateopts); $('#totval').jqxNumberInput(Show2dec); + var localizationobj = {}; + localizationobj.filterchoosestring= "Keuze:"; + // initialize jqxGrid $('#jqxgrid').jqxGrid({ width: 1280, @@ -179,18 +178,18 @@ renderstatusbar: function(statusbar) { var container = $('
'); var addButton = $('
Nieuw
'); + 'src="images/add.png"/>Nieuw'); var impButton = $('
Import
'); + 'src="images/add.png"/>Import'); var expButton = $('
Export
'); + 'src="images/database.png"/>Export'); container.append(addButton); container.append(impButton); container.append(expButton); statusbar.append(container); - addButton.jqxButton({ theme: theme, width: 90, height: 20 }); - impButton.jqxButton({ theme: theme, width: 90, height: 20 }); - expButton.jqxButton({ theme: theme, width: 90, height: 20 }); + addButton.jqxButton({ theme: theme, width: 90, height: 17 }); + impButton.jqxButton({ theme: theme, width: 90, height: 17 }); + expButton.jqxButton({ theme: theme, width: 90, height: 17 }); // add new row. addButton.click(function(event) { editrow = -1; @@ -216,13 +215,16 @@ window.open('export_miscs.php'); }); }, + ready: function () { + $("#jqxgrid").jqxGrid('localizestrings', localizationobj); + }, filterable: true, - filtermode: 'excel', + showfilterrow: true, columns: [ - { text: 'Ingredient naam', datafield: 'name', menu: false }, - { text: 'Type', datafield: 'type', align: 'left', width: 120 }, - { text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120 }, - { text: 'Tijd', datafield: 'time', width: 90, align: 'left', menu: false, + { text: 'Ingredient naam', datafield: 'name', filtertype: 'textbox' }, + { text: 'Type', datafield: 'type', align: 'left', width: 120, filtertype: 'list' }, + { text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120, filtertype: 'list' }, + { text: 'Tijd', datafield: 'time', width: 90, align: 'left', filterable: false, cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { var duration = ''; if (value > 0) { @@ -242,7 +244,7 @@ return '' + duration + ''; } }, - { text: 'Voorraad', datafield: 'inventory', width: 110, menu: false, align: 'right', + { text: 'Voorraad', datafield: 'inventory', width: 110, align: 'right', filtertype: 'number', filtercondition: 'not_equal', cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { var amount = ''; if (value > 0) { @@ -254,8 +256,8 @@ return '' + amount + ''; } }, - { text: 'THT datum', datafield: 'tht_date', width: 100, menu: false, align: 'center', cellsalign: 'center' }, - { text: '', datafield: 'Edit', columntype: 'button', width: 100, menu: false, align: 'center', + { text: 'THT datum', datafield: 'tht_date', width: 100, align: 'center', cellsalign: 'center', filtertype: 'date' }, + { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', filterable: false, cellsrenderer: function() { return 'Wijzig'; }, buttonclick: function(row) {