www/js/prod_edit.js

changeset 380
2242521067a7
parent 376
1de1623e1760
child 381
0ec81755396e
equal deleted inserted replaced
379:2aa6addc1853 380:2242521067a7
3201 $("#fermentableGrid").jqxGrid({ 3201 $("#fermentableGrid").jqxGrid({
3202 width: 1240, 3202 width: 1240,
3203 height: 470, 3203 height: 470,
3204 source: fermentableAdapter, 3204 source: fermentableAdapter,
3205 theme: theme, 3205 theme: theme,
3206 sortmode: "many",
3206 selectionmode: 'singlerow', 3207 selectionmode: 'singlerow',
3207 showtoolbar: true, 3208 showtoolbar: true,
3208 rendertoolbar: function (toolbar) { 3209 rendertoolbar: function (toolbar) {
3209 var me = this; 3210 var me = this;
3210 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 3211 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
3320 calcFermentables(); 3321 calcFermentables();
3321 calcIBUs(); 3322 calcIBUs();
3322 }); 3323 });
3323 }, 3324 },
3324 ready: function() { 3325 ready: function() {
3326 var datainformation = $('#fermentableGrid').jqxGrid('getdatainformation');
3327 if (datainformation.rowscount) {
3328 $("#fermentableGrid").jqxGrid('sortby', 'f_added', 'asc');
3329 $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc');
3330 }
3325 calcFermentables(); 3331 calcFermentables();
3326 $('#jqxTabs').jqxTabs('next'); 3332 $('#jqxTabs').jqxTabs('next');
3327 }, 3333 },
3328 columns: [ 3334 columns: [
3329 { text: 'Vergistbaar ingredi&euml;nt', datafield: 'f_name', 3335 { text: 'Vergistbaar ingredi&euml;nt', datafield: 'f_name',
3430 $("#hopGrid").jqxGrid({ 3436 $("#hopGrid").jqxGrid({
3431 width: 1240, 3437 width: 1240,
3432 height: 560, 3438 height: 560,
3433 source: hopAdapter, 3439 source: hopAdapter,
3434 theme: theme, 3440 theme: theme,
3441 sortmode: "many",
3435 selectionmode: 'singlerow', 3442 selectionmode: 'singlerow',
3436 showtoolbar: true, 3443 showtoolbar: true,
3437 rendertoolbar: function (toolbar) { 3444 rendertoolbar: function (toolbar) {
3438 var me = this; 3445 var me = this;
3439 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 3446 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
3504 } 3511 }
3505 calcIBUs(); 3512 calcIBUs();
3506 }); 3513 });
3507 }, 3514 },
3508 ready: function() { 3515 ready: function() {
3516 var datainformation = $('#hopGrid').jqxGrid('getdatainformation');
3517 if (datainformation.rowscount) {
3518 $("#hopGrid").jqxGrid('sortby', 'h_useat', 'asc');
3519 $("#hopGrid").jqxGrid('sortby', 'h_time', 'desc');
3520 $("#hopGrid").jqxGrid('sortby', 'h_amount', 'desc');
3521 }
3509 calcIBUs(); 3522 calcIBUs();
3510 $('#jqxTabs').jqxTabs('next'); 3523 $('#jqxTabs').jqxTabs('next');
3511 }, 3524 },
3512 columns: [ 3525 columns: [
3513 { text: 'Hop', datafield: 'h_name', 3526 { text: 'Hop', datafield: 'h_name',
3689 $("#miscGrid").jqxGrid({ 3702 $("#miscGrid").jqxGrid({
3690 width: 1240, 3703 width: 1240,
3691 height: 575, 3704 height: 575,
3692 source: miscAdapter, 3705 source: miscAdapter,
3693 theme: theme, 3706 theme: theme,
3707 sortmode: "many",
3694 selectionmode: 'singlerow', 3708 selectionmode: 'singlerow',
3695 showtoolbar: true, 3709 showtoolbar: true,
3696 rendertoolbar: function (toolbar) { 3710 rendertoolbar: function (toolbar) {
3697 var me = this; 3711 var me = this;
3698 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 3712 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
3746 var commit = $("#miscGrid").jqxGrid('deleterow', id); 3760 var commit = $("#miscGrid").jqxGrid('deleterow', id);
3747 } 3761 }
3748 }); 3762 });
3749 }, 3763 },
3750 ready: function() { 3764 ready: function() {
3765 var datainformation = $('#miscGrid').jqxGrid('getdatainformation');
3766 if (datainformation.rowscount) {
3767 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc');
3768 $("#miscGrid").jqxGrid('sortby', 'm_type', 'asc');
3769 }
3751 calcMiscs(); 3770 calcMiscs();
3752 $('#jqxTabs').jqxTabs('next'); 3771 $('#jqxTabs').jqxTabs('next');
3753 }, 3772 },
3754 columns: [ 3773 columns: [
3755 { text: 'Ingredient', datafield: 'm_name' }, 3774 { text: 'Ingredient', datafield: 'm_name' },
3860 $("#yeastGrid").jqxGrid({ 3879 $("#yeastGrid").jqxGrid({
3861 width: 1240, 3880 width: 1240,
3862 height: 350, 3881 height: 350,
3863 source: yeastAdapter, 3882 source: yeastAdapter,
3864 theme: theme, 3883 theme: theme,
3884 sortmode: "many",
3865 selectionmode: 'singlerow', 3885 selectionmode: 'singlerow',
3866 showtoolbar: true, 3886 showtoolbar: true,
3867 rendertoolbar: function (toolbar) { 3887 rendertoolbar: function (toolbar) {
3868 var me = this; 3888 var me = this;
3869 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 3889 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
3930 calcYeast(); 3950 calcYeast();
3931 } 3951 }
3932 }); 3952 });
3933 }, 3953 },
3934 ready: function() { 3954 ready: function() {
3955 var datainformation = $('#yeastGrid').jqxGrid('getdatainformation');
3956 if (datainformation.rowscount) {
3957 $("#yeastGrid").jqxGrid('sortby', 'y_use', 'asc');
3958 }
3935 calcFermentables(); 3959 calcFermentables();
3936 showStarter(); 3960 showStarter();
3937 calcYeast(); 3961 calcYeast();
3938 $('#jqxTabs').jqxTabs('next'); 3962 $('#jqxTabs').jqxTabs('next');
3939 }, 3963 },
4367 cancelButton: $("#FermentableReady"), 4391 cancelButton: $("#FermentableReady"),
4368 modalOpacity: 0.40 4392 modalOpacity: 0.40
4369 }); 4393 });
4370 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); 4394 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme });
4371 $("#FermentableReady").click(function () { 4395 $("#FermentableReady").click(function () {
4372 $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc');
4373 // Recalc percentages 4396 // Recalc percentages
4374 calcFermentables(); 4397 calcFermentables();
4375 calcIBUs(); 4398 calcIBUs();
4376 calcMash(); 4399 calcMash();
4377 // Waters: yes there is impact. 4400 // Waters: yes there is impact.
4594 cancelButton: $("#HopReady"), 4617 cancelButton: $("#HopReady"),
4595 modalOpacity: 0.40 4618 modalOpacity: 0.40
4596 }); 4619 });
4597 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme }); 4620 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme });
4598 $("#HopReady").click(function () { 4621 $("#HopReady").click(function () {
4599 $("#hopGrid").jqxGrid('sortby', 'h_amount', 'asc');
4600 calcIBUs(); 4622 calcIBUs();
4601 }); 4623 });
4602 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 }); 4624 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 });
4603 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 }); 4625 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 });
4604 $("#wh_instock").on('change', function (event) { 4626 $("#wh_instock").on('change', function (event) {
4733 cancelButton: $("#MiscReady"), 4755 cancelButton: $("#MiscReady"),
4734 modalOpacity: 0.40 4756 modalOpacity: 0.40
4735 }); 4757 });
4736 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme }); 4758 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme });
4737 $("#MiscReady").click(function () { 4759 $("#MiscReady").click(function () {
4738 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc');
4739 calcMiscs(); 4760 calcMiscs();
4740 }); 4761 });
4741 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 }); 4762 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 });
4742 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 }); 4763 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 });
4743 $("#wm_instock").on('change', function (event) { 4764 $("#wm_instock").on('change', function (event) {
4841 }); 4862 });
4842 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme }); 4863 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme });
4843 $("#YeastReady").click(function () { 4864 $("#YeastReady").click(function () {
4844 calcFermentables(); 4865 calcFermentables();
4845 calcYeast(); 4866 calcYeast();
4846 $("#yeastGrid").jqxGrid('sortby', 'y_use', 'asc');
4847 }); 4867 });
4848 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 }); 4868 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 });
4849 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); 4869 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 });
4850 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 }); 4870 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 });
4851 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 }); 4871 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 });

mercurial