diff -r 89b7449d1fd9 -r 3ce3df681be0 www/js/inv_yeasts.js --- a/www/js/inv_yeasts.js Thu Jun 11 19:59:30 2020 +0200 +++ b/www/js/inv_yeasts.js Sat Jun 13 12:14:26 2020 +0200 @@ -3,7 +3,7 @@ * * 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 @@ -114,9 +114,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) { @@ -131,9 +129,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) { @@ -148,9 +144,7 @@ commit(true); location.reload(true); }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } + error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); } }, @@ -228,6 +222,9 @@ autoDropDownHeight: true }); + var localizationobj = {}; + localizationobj.filterchoosestring= "Keuze:"; + // initialize jqxGrid $('#jqxgrid').jqxGrid({ width: 1280, @@ -239,18 +236,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; @@ -290,16 +287,19 @@ window.open('export_yeasts.php'); }); }, + ready: function () { + $("#jqxgrid").jqxGrid('localizestrings', localizationobj); + }, filterable: true, - filtermode: 'excel', + showfilterrow: true, columns: [ - { text: 'Laboratorium', datafield: 'laboratory', width: 150 }, - { text: 'Product ID', datafield: 'product_id', width: 120, menu: false }, - { text: 'Gist naam', datafield: 'name', menu: false }, - { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 110 }, - { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 110 }, - { text: 'SVG', datafield: 'attenuation', width: 70, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, - { text: 'Tol%', datafield: 'tolerance', width: 60, align: 'right', cellsalign: 'right', menu: false, + { text: 'Laboratorium', datafield: 'laboratory', width: 150, filtertype: 'list' }, + { text: 'Product ID', datafield: 'product_id', width: 120, filtertype: 'textbox' }, + { text: 'Gist naam', datafield: 'name', filtertype: 'textbox' }, + { text: 'Type', datafield: 'type', align: 'center', cellsalign: 'center', width: 110, filtertype: 'list' }, + { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 110, filtertype: 'list' }, + { text: 'SVG', datafield: 'attenuation', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'p1', filtertype: 'number' }, + { text: 'Tol%', datafield: 'tolerance', width: 60, align: 'right', cellsalign: 'right', filtertype: 'number', cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { var amount = ''; if (value > 0) @@ -307,7 +307,7 @@ return '' + amount + ''; } }, - { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: 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) { @@ -323,7 +323,7 @@ return '' + amount + ''; } }, - { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', menu: false, cellsrenderer: function() { + { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', filterable: false, cellsrenderer: function() { return 'Wijzig'; }, buttonclick: function(row) { // open the popup window when the user clicks a button.