diff -r 89b7449d1fd9 -r 3ce3df681be0 www/js/inv_hops.js --- a/www/js/inv_hops.js Thu Jun 11 19:59:30 2020 +0200 +++ b/www/js/inv_hops.js Sat Jun 13 12:14:26 2020 +0200 @@ -1,9 +1,9 @@ /***************************************************************************** - * Copyright (C) 2014-2019 + * Copyright (C) 2014-2020 * * Michiel Broek * - * This file is part of BrewCloud + * 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 @@ -89,9 +89,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) { @@ -106,9 +104,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) { @@ -123,9 +119,7 @@ commit(true); location.reload(true); }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } + error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); } }, @@ -171,6 +165,9 @@ $('#total_oil').jqxNumberInput(Perc1dec); $('#totval').jqxNumberInput(Show2dec); + var localizationobj = {}; + localizationobj.filterchoosestring= "Keuze:"; + // initialize jqxGrid $('#jqxgrid').jqxGrid({ width: 1280, @@ -182,18 +179,18 @@ var container, addButton, impButton; container = $('
'); addButton = $('
Nieuw
'); + 'src="images/add.png"/>Nieuw'); impButton = $('
Import
'); + 'src="images/add.png"/>Import'); 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; @@ -226,19 +223,22 @@ window.open('export_hops.php'); }); }, + ready: function () { + $("#jqxgrid").jqxGrid('localizestrings', localizationobj); + }, filterable: true, - filtermode: 'excel', + showfilterrow: true, columns: [ - { text: 'Herkomst', datafield: 'origin', width: 150 }, - { text: 'Hop Naam', datafield: 'name', menu: false }, - { text: 'Soort', datafield: 'type', align: 'left', width: 90 }, - { text: 'Vorm', datafield: 'form', align: 'left', width: 90 }, - { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, - { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, - { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, - { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'f1' }, - { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', menu: false, width: 110 }, - { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'f1', + { text: 'Herkomst', datafield: 'origin', width: 150, filtertype: 'list' }, + { text: 'Hop Naam', datafield: 'name', filtertype: 'textbox' }, + { text: 'Soort', datafield: 'type', align: 'left', width: 90, filtertype: 'list' }, + { text: 'Vorm', datafield: 'form', align: 'left', width: 90, filtertype: 'list' }, + { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1', filtertype: 'number' }, + { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1', filtertype: 'number' }, + { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1', filterable: false }, + { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1', filterable: false }, + { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', width: 110, filtertype: 'date' }, + { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', filtertype: 'number', filtercondition: 'not_equal', cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { var amount = ''; if (value > 0) { @@ -250,7 +250,7 @@ return '' + amount + ''; } }, - { text: '', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', menu: false, + { text: '', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', filterable: false, cellsrenderer: function() { return 'Wijzig'; }, buttonclick: function(row) {