www/js/inv_fermentables.js

changeset 202
64a9c935a66b
parent 199
dad62ec9af18
child 245
3649c3d31d15
equal deleted inserted replaced
201:f9b7e3f6be7c 202:64a9c935a66b
237 }); 237 });
238 }, 238 },
239 filterable: true, 239 filterable: true,
240 filtermode: 'excel', 240 filtermode: 'excel',
241 columns: [ 241 columns: [
242 { text: 'Herkomst', datafield: 'origin', width: 150 },
242 { text: 'Producent', datafield: 'supplier', width: 140 }, 243 { text: 'Producent', datafield: 'supplier', width: 140 },
243 { text: 'Vergistbaar product', datafield: 'name' }, 244 { text: 'Vergistbaar product', datafield: 'name', menu: false },
244 { text: 'Soort', width: 135, filtertype: 'list', /*filteritems: FermentableTypeAdapter, displayfield: 'nl',*/ datafield: 'type', 245 { text: 'Soort', width: 135, filtertype: 'list', /*filteritems: FermentableTypeAdapter, displayfield: 'nl',*/ datafield: 'type',
245 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { 246 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
246 return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[rowdata.type].nl + "</div>"; 247 return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[rowdata.type].nl + "</div>";
247 }, 248 },
248 // createfilterwidget: function (column, htmlElement, editor) { 249 // createfilterwidget: function (column, htmlElement, editor) {
260 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125, 261 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125,
261 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { 262 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
262 return "<div style='margin: 4px;' class='jqx-center-align'>" + GrainTypeData[value].nl + "</div>"; 263 return "<div style='margin: 4px;' class='jqx-center-align'>" + GrainTypeData[value].nl + "</div>";
263 } 264 }
264 }, 265 },
265 { text: 'Herkomst', datafield: 'origin', width: 150 }, 266 { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' },
266 { text: 'EBC', datafield: 'color', width: 60, align: 'right', cellsalign: 'right' }, 267 { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' },
267 { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, 268 { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false,
268 { text: 'Vooraad', datafield: 'inventory', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, 269 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
269 { text: 'Prijs/kg', datafield: 'cost', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'c2' }, 270 if (value == 0)
270 { text: 'Wijzig', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () { 271 return "<div style='margin: 4px;' class='jqx-right-align'></div>";
272 if (value < 1)
273 return "<div style='margin: 4px;' class='jqx-right-align'>"+value * 1000+" gr</div>";
274 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f1")+" kg</div>";
275 }
276 },
277 { text: 'Wijzig', datafield: 'Edit', width: 100, align: 'center', menu: false, columntype: 'button', cellsrenderer: function () {
271 return "Wijzig"; 278 return "Wijzig";
272 }, buttonclick: function (row) { 279 }, buttonclick: function (row) {
273 // open the popup window when the user clicks a button. 280 // open the popup window when the user clicks a button.
274 editrow = row; 281 editrow = row;
275 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); 282 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });

mercurial