# HG changeset patch # User Michiel Broek # Date 1548444240 -3600 # Node ID e29b53962cd132063f13490b198101f6b056605c # Parent 64a9c935a66b81663d18ef18a4c9ede78bfb6634 Hops inventory disable filter menu on some fields. Friendy display of stock inventory. diff -r 64a9c935a66b -r e29b53962cd1 www/js/inv_hops.js --- a/www/js/inv_hops.js Fri Jan 25 16:57:59 2019 +0100 +++ b/www/js/inv_hops.js Fri Jan 25 20:24:00 2019 +0100 @@ -132,8 +132,6 @@ }); } }; - var srcType = [ "Bittering", "Aroma", "Both" ]; - var srcForm = [ "Pellet", "Plug", "Leaf" ]; // initialize the input fields. $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); $("#alpha").jqxNumberInput( Perc1dec1 ); @@ -219,26 +217,33 @@ filterable: true, filtermode: 'excel', columns: [ - { text: 'Herkomst', datafield: 'origin', align: 'center', cellsalign: 'center', width: 150 }, - { text: 'Hop Naam', datafield: 'name' }, - { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 90, + { text: 'Herkomst', datafield: 'origin', width: 150 }, + { text: 'Hop Naam', datafield: 'name', menu: false }, + { text: 'Soort', datafield: 'type', align: 'center', menu: false, width: 90, cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { return "
" + HopTypeData[value].nl + "
"; } }, - { text: 'Vorm', datafield: 'form', align: 'center', cellsalign: 'center', width: 90, + { text: 'Vorm', datafield: 'form', align: 'center', menu: false, width: 90, cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { return "
" + HopFormData[value].nl + "
"; } }, - { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, - { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, - { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, - { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', width: 100 }, - { text: 'Voor, gr.', datafield: 'inventory', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Prijs /kg', datafield: 'cost', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, - { text: 'Wijzig', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { + { 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', + cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { + if (value == 0) + return "
"; + if (value < 1000) + return "
"+dataAdapter.formatNumber(value,"f1")+" gr
"; + return "
"+dataAdapter.formatNumber(value / 1000.0,"f1")+" kg
"; + } + }, + { text: 'Wijzig', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', menu: false, cellsrenderer: function () { return "Wijzig"; }, buttonclick: function (row) { // open the popup window when the user clicks a button.