19 * along with ThermFerm; see the file COPYING. If not, write to the Free |
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. |
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
21 *****************************************************************************/ |
21 *****************************************************************************/ |
22 |
22 |
23 |
23 |
24 $(document).ready(function () { |
24 $(document).ready(function() { |
25 var source = { |
25 var source = { |
26 datatype: "json", |
26 datatype: 'json', |
27 cache: false, |
27 cache: false, |
28 datafields: [ |
28 datafields: [ |
29 { name: 'record', type: 'number' }, |
29 { name: 'record', type: 'number' }, |
30 { name: 'name', type: 'string' }, |
30 { name: 'name', type: 'string' }, |
31 { name: 'code', type: 'string' }, |
31 { name: 'code', type: 'string' }, |
32 { name: 'date', type: 'string' }, |
32 { name: 'date', type: 'string' }, |
33 { name: 'style', type: 'string' }, |
33 { name: 'style', type: 'string' }, |
34 { name: 'og', type: 'float' }, |
34 { name: 'og', type: 'float' }, |
35 { name: 'fg', type: 'float' }, |
35 { name: 'fg', type: 'float' }, |
36 { name: 'batch_size', type: 'float' }, |
36 { name: 'batch_size', type: 'float' }, |
37 ], |
37 ], |
38 id: 'record', |
38 id: 'record', |
39 url: "includes/db_product.php?select=archcode" |
39 url: 'includes/db_product.php?select=archcode' |
40 }, |
40 }, |
41 dataAdapter = new $.jqx.dataAdapter(source); |
41 dataAdapter = new $.jqx.dataAdapter(source); |
42 |
42 |
43 // initialize jqxGrid |
43 // initialize jqxGrid |
44 $("#jqxgrid").jqxGrid({ |
44 $('#jqxgrid').jqxGrid({ |
45 width: 1280, |
45 width: 1280, |
46 height: 630, |
46 height: 630, |
47 source: dataAdapter, |
47 source: dataAdapter, |
48 theme: theme, |
48 theme: theme, |
49 columns: [ |
49 columns: [ |
50 { text: 'Code', datafield: 'code', width: 100 }, |
50 { text: 'Code', datafield: 'code', width: 100 }, |
51 { text: 'Naam', datafield: 'name' }, |
51 { text: 'Naam', datafield: 'name' }, |
52 { text: 'Stijl', datafield: 'style', width: 250 }, |
52 { text: 'Stijl', datafield: 'style', width: 250 }, |
53 { text: 'OG', datafield: 'og', width: 80, cellsformat: 'f3' }, |
53 { text: 'OG', datafield: 'og', width: 80, cellsformat: 'f3' }, |
54 { text: 'FG', datafield: 'fg', width: 80, cellsformat: 'f3' }, |
54 { text: 'FG', datafield: 'fg', width: 80, cellsformat: 'f3' }, |
55 { text: 'Datum', datafield: 'date', width: 120 }, |
55 { text: 'Datum', datafield: 'date', width: 120 }, |
56 { text: 'Liters', datafield: 'batch_size', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
56 { text: 'Liters', datafield: 'batch_size', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
57 { text: '', datafield: 'Edit', width: 80, align: 'center', columntype: 'button', cellsrenderer: function () { |
57 { text: '', datafield: 'Edit', width: 80, align: 'center', columntype: 'button', cellsrenderer: function() { |
58 return "Bekijk"; |
58 return 'Bekijk'; |
59 }, buttonclick: function (row) { |
59 }, buttonclick: function(row) { |
60 var datarecord = dataAdapter.records[row]; |
60 var datarecord = dataAdapter.records[row]; |
61 window.location.href = "prod_edit.php?record=" + datarecord.record + "&select=archcode&return=prod_archive_code.php"; |
61 window.location.href = 'prod_edit.php?record=' + datarecord.record + '&select=archcode&return=prod_archive_code.php'; |
62 } |
62 } |
63 } |
63 } |
64 ], |
64 ], |
65 }); |
65 }); |
66 }); |
66 }); |