170 height: 23, |
170 height: 23, |
171 autoDropDownHeight: true |
171 autoDropDownHeight: true |
172 }); |
172 }); |
173 $("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
173 $("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 }); |
174 $("#di_ph").jqxNumberInput( Spin2pH ); |
174 $("#di_ph").jqxNumberInput( Spin2pH ); |
175 $("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.01 }); |
175 $("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 4, spinButtons: true }); |
176 $("#graintype").jqxDropDownList({ |
176 $("#graintype").jqxDropDownList({ |
177 theme: theme, |
177 theme: theme, |
178 source: GrainTypeAdapter, |
178 source: GrainTypeAdapter, |
179 valueMember: 'id', |
179 valueMember: 'id', |
180 displayMember: 'nl', |
180 displayMember: 'nl', |
184 }); |
184 }); |
185 $("#inventory").jqxNumberInput( Spin1dec ); |
185 $("#inventory").jqxNumberInput( Spin1dec ); |
186 $("#production_date").jqxDateTimeInput( Dateopts ); |
186 $("#production_date").jqxDateTimeInput( Dateopts ); |
187 $("#cost").jqxNumberInput( Spin2dec ); |
187 $("#cost").jqxNumberInput( Spin2dec ); |
188 $("#tht_date").jqxDateTimeInput( Dateopts ); |
188 $("#tht_date").jqxDateTimeInput( Dateopts ); |
189 $("#totval").jqxNumberInput( Spin2dec ); |
189 $("#totval").jqxNumberInput( Show2dec ); |
190 $("#totval").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false }); |
|
191 |
190 |
192 var dataAdapter = new $.jqx.dataAdapter(source); |
191 var dataAdapter = new $.jqx.dataAdapter(source); |
193 var editrow = -1; |
192 var editrow = -1; |
194 // initialize jqxGrid |
193 // initialize jqxGrid |
195 $("#jqxgrid").jqxGrid({ |
194 $("#jqxgrid").jqxGrid({ |
240 filtermode: 'excel', |
239 filtermode: 'excel', |
241 columns: [ |
240 columns: [ |
242 { text: 'Herkomst', datafield: 'origin', width: 150 }, |
241 { text: 'Herkomst', datafield: 'origin', width: 150 }, |
243 { text: 'Producent', datafield: 'supplier', width: 140 }, |
242 { text: 'Producent', datafield: 'supplier', width: 140 }, |
244 { text: 'Vergistbaar product', datafield: 'name', menu: false }, |
243 { text: 'Vergistbaar product', datafield: 'name', menu: false }, |
245 { text: 'Soort', width: 135, filtertype: 'list', /*filteritems: FermentableTypeAdapter, displayfield: 'nl',*/ datafield: 'type', |
244 { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type', |
246 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
245 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
247 return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[rowdata.type].nl + "</div>"; |
246 return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[rowdata.type].nl + "</div>"; |
248 }, |
247 }, |
249 // createfilterwidget: function (column, htmlElement, editor) { |
|
250 // editor.jqxDropDownList({ displayMember: "nl", valueMember: "id" }); |
|
251 // } |
|
252 // createfilterwidget: function (column, columnElement, widget) { |
|
253 // widget.jqxDropDownList({ dropDownWidth: 350 }); |
|
254 // } |
|
255 }, |
248 }, |
256 // { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 135, |
|
257 // cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
|
258 // return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[value].nl + "</div>"; |
|
259 // }, |
|
260 // }, |
|
261 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125, |
249 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125, |
262 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
250 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
263 return "<div style='margin: 4px;' class='jqx-center-align'>" + GrainTypeData[value].nl + "</div>"; |
251 return "<div style='margin: 4px;' class='jqx-center-align'>" + GrainTypeData[value].nl + "</div>"; |
264 } |
252 } |
265 }, |
253 }, |