# HG changeset patch # User Michiel Broek # Date 1567880826 -7200 # Node ID 5c7566f6d42a6c3bdf9fe98bcd9e3bfa5c6516a7 # Parent cdcc7460b6aba8c6101d40ad0393c753daa03d89 gjslint fixes. diff -r cdcc7460b6ab -r 5c7566f6d42a www/js/rec_main.js --- a/www/js/rec_main.js Sat Sep 07 19:44:50 2019 +0200 +++ b/www/js/rec_main.js Sat Sep 07 20:27:06 2019 +0200 @@ -21,64 +21,64 @@ *****************************************************************************/ -$(document).ready(function () { - var source = { - datatype: "json", - cache: false, - datafields: [ - { name: 'record', type: 'number' }, - { name: 'st_name', type: 'string' }, - { name: 'st_letter', type: 'string' }, - { name: 'st_guide', type: 'string' }, - { name: 'name', type: 'string' }, - { name: 'est_og', type: 'float' }, - { name: 'est_color', type: 'float' }, - { name: 'est_ibu', type: 'float' }, - { name: 'est_abv', type: 'float' }, - ], - id: 'record', - url: "includes/db_recipes.php" - }, - dataAdapter = new $.jqx.dataAdapter(source); +$(document).ready(function() { + var source = { + datatype: 'json', + cache: false, + datafields: [ + { name: 'record', type: 'number' }, + { name: 'st_name', type: 'string' }, + { name: 'st_letter', type: 'string' }, + { name: 'st_guide', type: 'string' }, + { name: 'name', type: 'string' }, + { name: 'est_og', type: 'float' }, + { name: 'est_color', type: 'float' }, + { name: 'est_ibu', type: 'float' }, + { name: 'est_abv', type: 'float' }, + ], + id: 'record', + url: 'includes/db_recipes.php' + }, + dataAdapter = new $.jqx.dataAdapter(source); - // initialize jqxGrid - $("#jqxgrid").jqxGrid({ - width: 1280, - height: 630, - source: dataAdapter, - groupable: true, - theme: theme, - showstatusbar: true, - renderstatusbar: function (statusbar) { - var addButton, container = $("
"); - addButton = $("
Add
"); - container.append(addButton); - statusbar.append(container); - addButton.jqxButton({ theme: theme, width: 100, height: 20 }); - // add new recipe. - addButton.click(function (event) { - window.location.href = "rec_new.php?return=rec_main.php"; - }); - }, - filterable: true, - filtermode: 'excel', - columns: [ - { text: 'Stijlgids', datafield: 'st_guide', width: 120 }, - { text: 'Letter', datafield: 'st_letter', width: 60 }, - { text: 'Stijl', datafield: 'st_name', width: 160 }, - { text: 'Naam', datafield: 'name' }, - { text: 'OG', datafield: 'est_og', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, - { text: 'EBC', datafield: 'est_color', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, - { text: 'IBU', datafield: 'est_ibu', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, - { text: 'ABV', datafield: 'est_abv', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, - { text: '', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () { - return "Wijzig"; - }, buttonclick: function (row) { - var datarecord = dataAdapter.records[row]; - window.location.href = "rec_edit.php?record=" + datarecord.record + "&return=rec_main.php"; - } - } - ], - groups: ['st_guide','st_letter' ] - }); + // initialize jqxGrid + $('#jqxgrid').jqxGrid({ + width: 1280, + height: 630, + source: dataAdapter, + groupable: true, + theme: theme, + showstatusbar: true, + renderstatusbar: function(statusbar) { + var addButton, container = $("
"); + addButton = $("
Add
"); + container.append(addButton); + statusbar.append(container); + addButton.jqxButton({ theme: theme, width: 100, height: 20 }); + // add new recipe. + addButton.click(function(event) { + window.location.href = 'rec_new.php?return=rec_main.php'; + }); + }, + filterable: true, + filtermode: 'excel', + columns: [ + { text: 'Stijlgids', datafield: 'st_guide', width: 120 }, + { text: 'Letter', datafield: 'st_letter', width: 60 }, + { text: 'Stijl', datafield: 'st_name', width: 160 }, + { text: 'Naam', datafield: 'name' }, + { text: 'OG', datafield: 'est_og', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, + { text: 'EBC', datafield: 'est_color', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, + { text: 'IBU', datafield: 'est_ibu', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, + { text: 'ABV', datafield: 'est_abv', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, + { text: '', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function() { + return 'Wijzig'; + }, buttonclick: function(row) { + var datarecord = dataAdapter.records[row]; + window.location.href = 'rec_edit.php?record=' + datarecord.record + '&return=rec_main.php'; + } + } + ], + groups: ['st_guide', 'st_letter'] + }); });