diff -r 89b7449d1fd9 -r 3ce3df681be0 www/js/inv_fermentables.js --- a/www/js/inv_fermentables.js Thu Jun 11 19:59:30 2020 +0200 +++ b/www/js/inv_fermentables.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 @@ -94,9 +94,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) { @@ -111,9 +109,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) { @@ -128,9 +124,7 @@ commit(true); location.reload(true); }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } + error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); } }, @@ -188,6 +182,9 @@ $('#tht_date').jqxDateTimeInput(Dateopts); $('#totval').jqxNumberInput(Show2dec); + var localizationobj = {}; + localizationobj.filterchoosestring= "Keuze:"; + // initialize jqxGrid $('#jqxgrid').jqxGrid({ width: 1280, @@ -199,18 +196,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; @@ -248,17 +245,20 @@ window.open('export_fermentables.php'); }); }, + ready: function () { + $("#jqxgrid").jqxGrid('localizestrings', localizationobj); + }, filterable: true, - filtermode: 'excel', + showfilterrow: true, columns: [ - { text: 'Herkomst', datafield: 'origin', width: 150 }, - { text: 'Producent', datafield: 'supplier', width: 140 }, - { text: 'Vergistbaar product', datafield: 'name', menu: false }, - { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type' }, - { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125 }, - { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' }, - { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' }, - { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, + { text: 'Herkomst', datafield: 'origin', width: 150, filtertype: 'list' }, + { text: 'Producent', datafield: 'supplier', width: 140, filtertype: 'list' }, + { text: 'Vergistbaar product', datafield: 'name', filtertype: 'textbox' }, + { text: 'Soort', datafield: 'type', width: 135, filtertype: 'list' }, + { text: 'Graan type', datafield: 'graintype', width: 125, align: 'center', cellsalign: 'center', filtertype: 'list' }, + { text: 'EBC', datafield: 'color', width: 70, align: 'right', cellsalign: 'right', filtertype: 'number' }, + { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'p1', filterable: false }, + { 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) { @@ -270,7 +270,7 @@ return '' + amount + ''; } }, - { text: '', datafield: 'Edit', width: 100, align: 'center', menu: false, columntype: 'button', + { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', filterable: false, cellsrenderer: function() { return 'Wijzig'; }, buttonclick: function(row) {