www/js/rec_edit.js

changeset 380
2242521067a7
parent 376
1de1623e1760
child 381
0ec81755396e
equal deleted inserted replaced
379:2aa6addc1853 380:2242521067a7
1774 $("#fermentableGrid").jqxGrid({ 1774 $("#fermentableGrid").jqxGrid({
1775 width: 1240, 1775 width: 1240,
1776 height: 470, 1776 height: 470,
1777 source: fermentableAdapter, 1777 source: fermentableAdapter,
1778 theme: theme, 1778 theme: theme,
1779 sortmode: "many",
1779 selectionmode: 'singlerow', 1780 selectionmode: 'singlerow',
1780 showtoolbar: true, 1781 showtoolbar: true,
1781 rendertoolbar: function (toolbar) { 1782 rendertoolbar: function (toolbar) {
1782 var me = this; 1783 var me = this;
1783 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 1784 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
1892 calcFermentables(); 1893 calcFermentables();
1893 calcIBUs(); 1894 calcIBUs();
1894 }); 1895 });
1895 }, 1896 },
1896 ready: function() { 1897 ready: function() {
1898 var datainformation = $('#fermentableGrid').jqxGrid('getdatainformation');
1899 if (datainformation.rowscount) {
1900 $("#fermentableGrid").jqxGrid('sortby', 'f_added', 'asc');
1901 $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc');
1902 }
1897 calcFermentables(); 1903 calcFermentables();
1898 $('#jqxTabs').jqxTabs('next'); 1904 $('#jqxTabs').jqxTabs('next');
1899 }, 1905 },
1900 columns: [ 1906 columns: [
1901 { text: 'Vergistbaar ingredi&euml;nt', datafield: 'f_name', 1907 { text: 'Vergistbaar ingredi&euml;nt', datafield: 'f_name',
1993 $("#hopGrid").jqxGrid({ 1999 $("#hopGrid").jqxGrid({
1994 width: 1240, 2000 width: 1240,
1995 height: 560, 2001 height: 560,
1996 source: hopAdapter, 2002 source: hopAdapter,
1997 theme: theme, 2003 theme: theme,
2004 sortmode: "many",
1998 selectionmode: 'singlerow', 2005 selectionmode: 'singlerow',
1999 showtoolbar: true, 2006 showtoolbar: true,
2000 rendertoolbar: function (toolbar) { 2007 rendertoolbar: function (toolbar) {
2001 var me = this; 2008 var me = this;
2002 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 2009 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2065 } 2072 }
2066 calcIBUs(); 2073 calcIBUs();
2067 }); 2074 });
2068 }, 2075 },
2069 ready: function() { 2076 ready: function() {
2077 var datainformation = $('#hopGrid').jqxGrid('getdatainformation');
2078 if (datainformation.rowscount) {
2079 $("#hopGrid").jqxGrid('sortby', 'h_useat', 'asc');
2080 $("#hopGrid").jqxGrid('sortby', 'h_time', 'desc');
2081 $("#hopGrid").jqxGrid('sortby', 'h_amount', 'desc');
2082 }
2070 calcIBUs(); 2083 calcIBUs();
2071 $('#jqxTabs').jqxTabs('next'); 2084 $('#jqxTabs').jqxTabs('next');
2072 }, 2085 },
2073 columns: [ 2086 columns: [
2074 { text: 'Hop', datafield: 'h_name', 2087 { text: 'Hop', datafield: 'h_name',
2243 $("#miscGrid").jqxGrid({ 2256 $("#miscGrid").jqxGrid({
2244 width: 1240, 2257 width: 1240,
2245 height: 575, 2258 height: 575,
2246 source: miscAdapter, 2259 source: miscAdapter,
2247 theme: theme, 2260 theme: theme,
2261 sortmode: "many",
2248 selectionmode: 'singlerow', 2262 selectionmode: 'singlerow',
2249 showtoolbar: true, 2263 showtoolbar: true,
2250 rendertoolbar: function (toolbar) { 2264 rendertoolbar: function (toolbar) {
2251 var me = this; 2265 var me = this;
2252 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 2266 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2299 var commit = $("#miscGrid").jqxGrid('deleterow', id); 2313 var commit = $("#miscGrid").jqxGrid('deleterow', id);
2300 } 2314 }
2301 }); 2315 });
2302 }, 2316 },
2303 ready: function() { 2317 ready: function() {
2318 var datainformation = $('#miscGrid').jqxGrid('getdatainformation');
2319 if (datainformation.rowscount) {
2320 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc');
2321 $("#miscGrid").jqxGrid('sortby', 'm_type', 'asc');
2322 }
2304 $('#jqxTabs').jqxTabs('next'); 2323 $('#jqxTabs').jqxTabs('next');
2305 }, 2324 },
2306 columns: [ 2325 columns: [
2307 { text: 'Ingredient', datafield: 'm_name' }, 2326 { text: 'Ingredient', datafield: 'm_name' },
2308 { text: 'Type', width: 140, datafield: 'm_type', 2327 { text: 'Type', width: 140, datafield: 'm_type',
2403 $("#yeastGrid").jqxGrid({ 2422 $("#yeastGrid").jqxGrid({
2404 width: 1240, 2423 width: 1240,
2405 height: 350, 2424 height: 350,
2406 source: yeastAdapter, 2425 source: yeastAdapter,
2407 theme: theme, 2426 theme: theme,
2427 sortmode: "many",
2408 selectionmode: 'singlerow', 2428 selectionmode: 'singlerow',
2409 showtoolbar: true, 2429 showtoolbar: true,
2410 rendertoolbar: function (toolbar) { 2430 rendertoolbar: function (toolbar) {
2411 var me = this; 2431 var me = this;
2412 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 2432 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
2470 var commit = $("#yeastGrid").jqxGrid('deleterow', id); 2490 var commit = $("#yeastGrid").jqxGrid('deleterow', id);
2471 } 2491 }
2472 }); 2492 });
2473 }, 2493 },
2474 ready: function() { 2494 ready: function() {
2495 var datainformation = $('#yeastGrid').jqxGrid('getdatainformation');
2496 if (datainformation.rowscount) {
2497 $("#yeastGrid").jqxGrid('sortby', 'y_use', 'asc');
2498 }
2475 calcFermentables(); 2499 calcFermentables();
2476 $('#jqxTabs').jqxTabs('next'); 2500 $('#jqxTabs').jqxTabs('next');
2477 }, 2501 },
2478 columns: [ 2502 columns: [
2479 { text: 'Gist', datafield: 'y_name' }, 2503 { text: 'Gist', datafield: 'y_name' },
2836 cancelButton: $("#FermentableReady"), 2860 cancelButton: $("#FermentableReady"),
2837 modalOpacity: 0.40 2861 modalOpacity: 0.40
2838 }); 2862 });
2839 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme }); 2863 $("#FermentableReady").jqxButton({ template: "success", width: '90px', theme: theme });
2840 $("#FermentableReady").click(function () { 2864 $("#FermentableReady").click(function () {
2841 $("#fermentableGrid").jqxGrid('sortby', 'f_amount', 'desc');
2842 // Recalc percentages 2865 // Recalc percentages
2843 calcFermentables(); 2866 calcFermentables();
2844 calcIBUs(); 2867 calcIBUs();
2845 calcMash(); 2868 calcMash();
2846 // Waters: yes there is impact. 2869 // Waters: yes there is impact.
3064 cancelButton: $("#HopReady"), 3087 cancelButton: $("#HopReady"),
3065 modalOpacity: 0.40 3088 modalOpacity: 0.40
3066 }); 3089 });
3067 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme }); 3090 $("#HopReady").jqxButton({ template: "success", width: '90px', theme: theme });
3068 $("#HopReady").click(function () { 3091 $("#HopReady").click(function () {
3069 $("#hopGrid").jqxGrid('sortby', 'h_amount', 'asc');
3070 calcIBUs(); 3092 calcIBUs();
3071 }); 3093 });
3072 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 }); 3094 $("#wh_name").jqxInput({ theme: theme, width: 320, height: 23 });
3073 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 }); 3095 $("#wh_instock").jqxCheckBox({ theme: theme, height: 23 });
3074 $("#wh_instock").on('change', function (event) { 3096 $("#wh_instock").on('change', function (event) {
3203 autoOpen: false, 3225 autoOpen: false,
3204 cancelButton: $("#MiscReady"), 3226 cancelButton: $("#MiscReady"),
3205 modalOpacity: 0.40 3227 modalOpacity: 0.40
3206 }); 3228 });
3207 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme }); 3229 $("#MiscReady").jqxButton({ template: "success", width: '90px', theme: theme });
3208 $("#MiscReady").click(function () {
3209 $("#miscGrid").jqxGrid('sortby', 'm_use_use', 'asc');
3210 });
3211 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 }); 3230 $("#wm_name").jqxInput({ theme: theme, width: 320, height: 23 });
3212 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 }); 3231 $("#wm_instock").jqxCheckBox({ theme: theme, height: 23 });
3213 $("#wm_instock").on('change', function (event) { 3232 $("#wm_instock").on('change', function (event) {
3214 miscinstock = event.args.checked; 3233 miscinstock = event.args.checked;
3215 misclist.dataBind(); 3234 misclist.dataBind();
3307 modalOpacity: 0.40 3326 modalOpacity: 0.40
3308 }); 3327 });
3309 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme }); 3328 $("#YeastReady").jqxButton({ template: "success", width: '90px', theme: theme });
3310 $("#YeastReady").click(function () { 3329 $("#YeastReady").click(function () {
3311 calcFermentables(); 3330 calcFermentables();
3312 $("#yeastGrid").jqxGrid('sortby', 'y_use', 'asc');
3313 }); 3331 });
3314 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 }); 3332 $("#wy_name").jqxInput({ theme: theme, width: 320, height: 23 });
3315 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 }); 3333 $("#wy_laboratory").jqxInput({ theme: theme, width: 320, height: 23 });
3316 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 }); 3334 $("#wy_product_id").jqxInput({ theme: theme, width: 320, height: 23 });
3317 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 }); 3335 $("#wy_instock").jqxCheckBox({ theme: theme, height: 23 });

mercurial