180 showstatusbar: true, |
177 showstatusbar: true, |
181 renderstatusbar: function(statusbar) { |
178 renderstatusbar: function(statusbar) { |
182 var container, addButton, impButton; |
179 var container, addButton, impButton; |
183 container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); |
180 container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); |
184 addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
181 addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
185 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Nieuw</span></div>'); |
182 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>'); |
186 impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
183 impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
187 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Import</span></div>'); |
184 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Import</span></div>'); |
188 expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
185 expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
189 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Export</span></div>'); |
186 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>'); |
190 container.append(addButton); |
187 container.append(addButton); |
191 container.append(impButton); |
188 container.append(impButton); |
192 container.append(expButton); |
189 container.append(expButton); |
193 statusbar.append(container); |
190 statusbar.append(container); |
194 addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
191 addButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
195 impButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
192 impButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
196 expButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
193 expButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
197 // add new row. |
194 // add new row. |
198 addButton.click(function(event) { |
195 addButton.click(function(event) { |
199 editrow = -1; |
196 editrow = -1; |
200 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
197 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
201 $('#name').val('Nieuwe hop'); |
198 $('#name').val('Nieuwe hop'); |
224 }); |
221 }); |
225 expButton.click(function(event) { |
222 expButton.click(function(event) { |
226 window.open('export_hops.php'); |
223 window.open('export_hops.php'); |
227 }); |
224 }); |
228 }, |
225 }, |
|
226 ready: function () { |
|
227 $("#jqxgrid").jqxGrid('localizestrings', localizationobj); |
|
228 }, |
229 filterable: true, |
229 filterable: true, |
230 filtermode: 'excel', |
230 showfilterrow: true, |
231 columns: [ |
231 columns: [ |
232 { text: 'Herkomst', datafield: 'origin', width: 150 }, |
232 { text: 'Herkomst', datafield: 'origin', width: 150, filtertype: 'list' }, |
233 { text: 'Hop Naam', datafield: 'name', menu: false }, |
233 { text: 'Hop Naam', datafield: 'name', filtertype: 'textbox' }, |
234 { text: 'Soort', datafield: 'type', align: 'left', width: 90 }, |
234 { text: 'Soort', datafield: 'type', align: 'left', width: 90, filtertype: 'list' }, |
235 { text: 'Vorm', datafield: 'form', align: 'left', width: 90 }, |
235 { text: 'Vorm', datafield: 'form', align: 'left', width: 90, filtertype: 'list' }, |
236 { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
236 { text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1', filtertype: 'number' }, |
237 { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
237 { text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1', filtertype: 'number' }, |
238 { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' }, |
238 { text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1', filterable: false }, |
239 { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'f1' }, |
239 { text: 'HSI', datafield: 'hsi', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f1', filterable: false }, |
240 { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', menu: false, width: 110 }, |
240 { text: 'Oogst datum', datafield: 'production_date', align: 'center', cellsalign: 'center', width: 110, filtertype: 'date' }, |
241 { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'f1', |
241 { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', filtertype: 'number', filtercondition: 'not_equal', |
242 cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
242 cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { |
243 var amount = ''; |
243 var amount = ''; |
244 if (value > 0) { |
244 if (value > 0) { |
245 if (value < 1000) |
245 if (value < 1000) |
246 amount = dataAdapter.formatNumber(value, 'f1') + ' gr'; |
246 amount = dataAdapter.formatNumber(value, 'f1') + ' gr'; |
248 amount = dataAdapter.formatNumber(value / 1000.0, 'f1') + ' kg'; |
248 amount = dataAdapter.formatNumber(value / 1000.0, 'f1') + ' kg'; |
249 } |
249 } |
250 return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; |
250 return '<span style="margin: 4px; margin-top: 6px; float: right;">' + amount + '</span>'; |
251 } |
251 } |
252 }, |
252 }, |
253 { text: '', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', menu: false, |
253 { text: '', datafield: 'Wijzig', columntype: 'button', width: 100, align: 'center', filterable: false, |
254 cellsrenderer: function() { |
254 cellsrenderer: function() { |
255 return 'Wijzig'; |
255 return 'Wijzig'; |
256 }, buttonclick: function(row) { |
256 }, buttonclick: function(row) { |
257 // open the popup window when the user clicks a button. |
257 // open the popup window when the user clicks a button. |
258 editrow = row; |
258 editrow = row; |