www/js/prod_archive_date.js

changeset 802
4a9f469d2201
parent 801
55c2510891b8
child 803
45e87aa8d02c
equal deleted inserted replaced
801:55c2510891b8 802:4a9f469d2201
1 /*****************************************************************************
2 * Copyright (C) 2019
3 *
4 * Michiel Broek <mbroek at mbse dot eu>
5 *
6 * This file is part of BMS
7 *
8 * This is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * BrewCloud is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *****************************************************************************/
22
23
24 $(document).ready(function() {
25 var source = {
26 datatype: 'json',
27 cache: false,
28 datafields: [
29 { name: 'record', type: 'number' },
30 { name: 'name', type: 'string' },
31 { name: 'code', type: 'string' },
32 { name: 'year', type: 'string' },
33 { name: 'date', type: 'string' },
34 { name: 'style', type: 'string' },
35 { name: 'og', type: 'float' },
36 { name: 'fg', type: 'float' },
37 { name: 'batch_size', type: 'float' },
38 ],
39 id: 'record',
40 url: 'includes/db_product.php?select=archdate'
41 },
42 dataAdapter = new $.jqx.dataAdapter(source);
43
44 // initialize jqxGrid
45 $('#jqxgrid').jqxGrid({
46 width: 1280,
47 height: 630,
48 source: dataAdapter,
49 groupable: true,
50 theme: theme,
51 columns: [
52 { text: 'Jaar', datafield: 'year', width: 80 },
53 { text: 'Datum', datafield: 'date', width: 120, menu: false },
54 { text: 'Naam', datafield: 'name', menu: false },
55 { text: 'Stijl', datafield: 'style', width: 250 },
56 { text: 'OG', datafield: 'og', width: 80, cellsformat: 'f3', menu: false },
57 { text: 'FG', datafield: 'fg', width: 80, cellsformat: 'f3', menu: false },
58 { text: 'Code', datafield: 'code', width: 100, menu: false },
59 { text: 'Liters', datafield: 'batch_size', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1', menu: false },
60 { text: '', datafield: 'Edit', width: 80, align: 'center', columntype: 'button', cellsrenderer: function() {
61 return 'Bekijk';
62 }, buttonclick: function(row) {
63 var datarecord = dataAdapter.records[row];
64 window.location.href = 'prod_edit.php?record=' + datarecord.record + '&select=archdate&return=prod_archive_date.php';
65 }
66 }
67 ],
68 groups: ['year']
69 });
70 });

mercurial