# HG changeset patch # User Michiel Broek # Date 1584538571 -3600 # Node ID ab6423be2a1e6d4214f8da84f40159b759c0d14d # Parent 048932246071dc7002d8d2098bc12d766ce2018f A lot more debug messages diff -r 048932246071 -r ab6423be2a1e www/js/prod_edit.js --- a/www/js/prod_edit.js Tue Mar 17 20:25:20 2020 +0100 +++ b/www/js/prod_edit.js Wed Mar 18 14:36:11 2020 +0100 @@ -328,8 +328,10 @@ // Load data and select one record. dataAdapter = new $.jqx.dataAdapter(source, { loadComplete: function() { + console.log('main data begin load'); var records = dataAdapter.records; dataRecord = records[0]; + console.log('main data ' + records.length + ' records'); // Hidden record uuid $('#name').val(dataRecord.name); $('#code').val(dataRecord.code); @@ -549,14 +551,20 @@ // hidden divide_factor // hidden divide_parts // hidden divide_part + console.log('set editFermentable'); editFermentable(dataRecord); + console.log('set editHop'); editHop(dataRecord); + console.log('set editMisc'); editMisc(dataRecord); + console.log('set editYeast'); editYeast(dataRecord); + console.log('set editMash'); editMash(dataRecord); console.log('main data loaded'); calcStage(); $('#jqxTabs').jqxTabs('select', 2); + console.log('main data ready'); }, loadError: function(jqXHR, status, error) { console.log('main data load error: ' + status + ' ' + error); @@ -569,7 +577,7 @@ localdata: data.fermentables, datatype: 'local', cache: false, - async: false, + async: true, datafields: [ { name: 'f_name', type: 'string' }, { name: 'f_origin', type: 'string' }, @@ -724,7 +732,7 @@ calcIBUs(); }); }, - ready: function() { $('#jqxTabs').jqxTabs('next'); }, + ready: function() { console.log('ready fermentables'); $('#jqxTabs').jqxTabs('next'); }, columns: [ { text: 'Vergistbaar ingrediënt', datafield: 'f_name', cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { @@ -810,7 +818,7 @@ localdata: data.hops, datatype: 'local', cache: false, - async: false, + async: true, datafields: [ { name: 'h_name', type: 'string' }, { name: 'h_origin', type: 'string' }, @@ -831,15 +839,9 @@ { name: 'h_inventory', type: 'float' }, { name: 'h_avail', type: 'int' } ], - addrow: function(rowid, rowdata, position, commit) { - commit(true); - }, - deleterow: function(rowid, commit) { - commit(true); - }, - updaterow: function(rowid, rowdata, commit) { - commit(true); - } + addrow: function(rowid, rowdata, position, commit) { commit(true); }, + deleterow: function(rowid, commit) { commit(true); }, + updaterow: function(rowid, rowdata, commit) { commit(true); } }, hopAdapter = new $.jqx.dataAdapter(hopSource); @@ -919,7 +921,7 @@ calcIBUs(); }); }, - ready: function() { $('#jqxTabs').jqxTabs('next'); }, + ready: function() { console.log('ready hops'); $('#jqxTabs').jqxTabs('next'); }, columns: [ { text: 'Hop', datafield: 'h_name', cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { @@ -1032,15 +1034,9 @@ { name: 'm_inventory', type: 'float' }, { name: 'm_avail', type: 'int' } ], - addrow: function(rowid, rowdata, position, commit) { - commit(true); - }, - deleterow: function(rowid, commit) { - commit(true); - }, - updaterow: function(rowid, rowdata, commit) { - commit(true); - } + addrow: function(rowid, rowdata, position, commit) { commit(true); }, + deleterow: function(rowid, commit) { commit(true); }, + updaterow: function(rowid, rowdata, commit) { commit(true); } }, miscAdapter = new $.jqx.dataAdapter(miscSource, { beforeLoadComplete: function(records) { @@ -1063,6 +1059,7 @@ $('#wa_nacl').val(row.m_amount * 1000); break; case 'Melkzuur': + console.log('setting the #wa_acid_name'); $('#wa_acid_name').val(0); $('#wa_acid').val(row.m_amount * 1000); $('#wa_acid_perc').val(80); @@ -1110,9 +1107,7 @@ } return data; }, - loadError: function(jqXHR, status, error) { - $('#err').text(status + ' ' + error); - }, + loadError: function(jqXHR, status, error) { console.log('miscs load error ' + status + ' ' + error); }, }); $('#miscGrid').jqxGrid({ width: 1240, @@ -1173,7 +1168,7 @@ } }); }, - ready: function() { $('#jqxTabs').jqxTabs('next'); }, + ready: function() { console.log('ready miscs'); $('#jqxTabs').jqxTabs('next'); }, columns: [ { text: 'Ingredient', datafield: 'm_name' }, { text: 'Type', width: 140, datafield: 'm_type', @@ -1284,18 +1279,9 @@ { name: 'y_zymocide', type: 'int' }, { name: 'y_avail', type: 'int' } ], - addrow: function(rowid, rowdata, position, commit) { - console.log('yeast addrow ' + rowid); - commit(true); - }, - deleterow: function(rowid, commit) { - console.log('yeast deleterow ' + rowid); - commit(true); - }, - updaterow: function(rowid, rowdata, commit) { - console.log('yeast updaterow ' + rowid); - commit(true); - } + addrow: function(rowid, rowdata, position, commit) { commit(true); }, + deleterow: function(rowid, commit) { commit(true); }, + updaterow: function(rowid, rowdata, commit) { commit(true); } }, yeastAdapter = new $.jqx.dataAdapter(yeastSource); @@ -1380,7 +1366,7 @@ } }); }, - ready: function() { $('#jqxTabs').jqxTabs('next'); }, + ready: function() { console.log('ready yeasts'); $('#jqxTabs').jqxTabs('next'); }, columns: [ { text: 'Gist', datafield: 'y_name' }, { text: 'Laboratorium', width: 150, datafield: 'y_laboratory' }, @@ -1556,6 +1542,7 @@ }, ready: function() { /* Calculate the whole recipe */ + console.log('ready mashs, start calculations'); calcFermentables(); whirlpoolHops(); calcIBUs(); @@ -1564,6 +1551,7 @@ calcYeast(); calcInit(); calcMash(); + console.log('calculations ready'); $('#jqxLoader').jqxLoader('close'); $('#jqxTabs').jqxTabs('first'); }, @@ -4491,6 +4479,7 @@ }; // dataAdapter.dataBind(); + console.log('start init input fields and selectors'); // initialize the input fields. // Tab 1, Algemeen @@ -6019,5 +6008,6 @@ saveRecord(1); }); createDelElements(); + console.log('reached the end'); });