www/js/rec_edit.js

changeset 331
8d7fad771dde
parent 317
454851b335ad
child 332
f0ca77097236
equal deleted inserted replaced
330:eebe99e9fd99 331:8d7fad771dde
1880 { text: 'Moment', width: 110, datafield: 'f_added', 1880 { text: 'Moment', width: 110, datafield: 'f_added',
1881 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { 1881 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
1882 return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + AddedData[value].nl + "</span>"; 1882 return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + AddedData[value].nl + "</span>";
1883 } 1883 }
1884 }, 1884 },
1885 { text:'Maxinbatch', datafield: 'f_max_in_batch', hidden: true },
1885 { text: 'Opbrengst', editable: false, datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, 1886 { text: 'Opbrengst', editable: false, datafield: 'f_yield', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' },
1886 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, 1887 { text: 'Gewicht Kg', datafield: 'f_amount', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f3' },
1887 { text: 'Voorr. Kg', datafield: 'f_inventory', width: 120, align: 'right', 1888 { text: 'Voorr. Kg', datafield: 'f_inventory', width: 120, align: 'right',
1888 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) { 1889 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
1889 var color = '#ffffff'; 1890 var color = '#ffffff';
1891 color = '#ff4040'; 1892 color = '#ff4040';
1892 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' + 1893 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' +
1893 color + ';">' +fermentableAdapter.formatNumber(value, "f3") + '</span>'; 1894 color + ';">' +fermentableAdapter.formatNumber(value, "f3") + '</span>';
1894 } 1895 }
1895 }, 1896 },
1896 { text: 'Procent', datafield: 'f_percentage', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, 1897 { text: 'Procent', datafield: 'f_percentage', width: 90, align: 'right',
1898 cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
1899 var color = '#ffffff';
1900 if (value > rowdata.f_max_in_batch)
1901 color = '#ff4040';
1902 return '<span style="margin: 4px; margin-top: 6px; float: right; color: ' +
1903 color + ';">' +fermentableAdapter.formatNumber(value, "p1") + '</span>';
1904 }
1905 },
1897 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 70 }, 1906 { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 70 },
1898 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { 1907 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () {
1899 return "Wijzig"; 1908 return "Wijzig";
1900 }, buttonclick: function (row) { 1909 }, buttonclick: function (row) {
1901 fermentableRow = row; 1910 fermentableRow = row;
1902 fermentableData = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow); 1911 fermentableData = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow);
1903 $("#wf_name").val(fermentableData.f_name); 1912 $("#wf_name").val(fermentableData.f_name);
1904 $("#wf_amount").val(fermentableData.f_amount); 1913 $("#wf_amount").val(fermentableData.f_amount);
1905 $("#wf_percentage").val(fermentableData.f_percentage); 1914 $("#wf_percentage").val(fermentableData.f_percentage);
1915 $("#wf_max_in_batch").val(fermentableData.f_max_in_batch);
1906 $("#wf_adjust_to_total_100").val(fermentableData.f_adjust_to_total_100); 1916 $("#wf_adjust_to_total_100").val(fermentableData.f_adjust_to_total_100);
1907 $("#wf_added").val(fermentableData.f_added); 1917 $("#wf_added").val(fermentableData.f_added);
1908 // show the popup window. 1918 // show the popup window.
1909 $("#popupFermentable").jqxWindow('open'); 1919 $("#popupFermentable").jqxWindow('open');
1910 } 1920 }
2910 } 2920 }
2911 } 2921 }
2912 } 2922 }
2913 2923
2914 }); 2924 });
2925 $("#wf_max_in_batch").jqxNumberInput( Show1dec );
2915 $("#wf_adjust_to_total_100").jqxCheckBox({ theme: theme, width: 120, height: 23 }); 2926 $("#wf_adjust_to_total_100").jqxCheckBox({ theme: theme, width: 120, height: 23 });
2916 $("#wf_adjust_to_total_100").on('checked', function (event) { 2927 $("#wf_adjust_to_total_100").on('checked', function (event) {
2917 if (fermentableData.f_adjust_to_total_100 == 0) { 2928 if (fermentableData.f_adjust_to_total_100 == 0) {
2918 if (to_100) { 2929 if (to_100) {
2919 // Reset other flag first. 2930 // Reset other flag first.

mercurial