Sun, 24 Feb 2019 23:26:01 +0100
Added view archives by name
290 | 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: 'birth', type: 'string' }, | |
33 | { name: 'batch_size', type: 'float' }, | |
34 | ], | |
35 | id: 'record', | |
36 | url: "includes/db_product.php?select=archname" | |
37 | }; | |
38 | var dataAdapter = new $.jqx.dataAdapter(source); | |
39 | // initialize jqxGrid | |
40 | $("#jqxgrid").jqxGrid({ | |
41 | width: 1280, | |
42 | height: 630, | |
43 | source: dataAdapter, | |
44 | theme: theme, | |
45 | columns: [ | |
46 | { text: 'Naam', datafield: 'name' }, | |
47 | { text: 'Datum', datafield: 'birth', width: 120 }, | |
48 | { text: 'Code', datafield: 'code', width: 120 }, | |
49 | { text: 'Liters', datafield: 'batch_size', width: 110, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, | |
50 | { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () { | |
51 | return "Bekijk"; | |
52 | }, buttonclick: function (row) { | |
53 | var datarecord = dataAdapter.records[row]; | |
54 | var url= "prod_edit.php?record=" + datarecord.record + "&select=archname&return=prod_archive_name.php"; | |
55 | window.location.href = url; | |
56 | } | |
57 | } | |
58 | ], | |
59 | }); | |
60 | }); |