181 showstatusbar: true, |
178 showstatusbar: true, |
182 renderstatusbar: function(statusbar) { |
179 renderstatusbar: function(statusbar) { |
183 var container, addButton, impButton; |
180 var container, addButton, impButton; |
184 container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); |
181 container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); |
185 addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
182 addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
186 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Nieuw</span></div>'); |
183 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>'); |
187 impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
184 impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
188 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Import</span></div>'); |
185 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Import</span></div>'); |
189 expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
186 expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
190 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Export</span></div>'); |
187 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -10px;">Export</span></div>'); |
191 container.append(addButton); |
188 container.append(addButton); |
192 container.append(impButton); |
189 container.append(impButton); |
193 container.append(expButton); |
190 container.append(expButton); |
194 statusbar.append(container); |
191 statusbar.append(container); |
195 addButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
192 addButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
196 impButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
193 impButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
197 expButton.jqxButton({ theme: theme, width: 90, height: 20 }); |
194 expButton.jqxButton({ theme: theme, width: 90, height: 17 }); |
198 // add new row. |
195 // add new row. |
199 addButton.click(function(event) { |
196 addButton.click(function(event) { |
200 editrow = -1; |
197 editrow = -1; |
201 $('#name').val('Nieuwe stijl'); |
198 $('#name').val('Nieuwe stijl'); |
202 $('#category').val(''); |
199 $('#category').val(''); |
227 }); |
224 }); |
228 expButton.click(function(event) { |
225 expButton.click(function(event) { |
229 window.open('export_styles.php'); |
226 window.open('export_styles.php'); |
230 }); |
227 }); |
231 }, |
228 }, |
|
229 ready: function () { |
|
230 $("#jqxgrid").jqxGrid('localizestrings', localizationobj); |
|
231 }, |
232 filterable: true, |
232 filterable: true, |
233 filtermode: 'excel', |
233 showfilterrow: true, |
234 columns: [ |
234 columns: [ |
235 { text: 'Gids', datafield: 'style_guide', width: 100 }, |
235 { text: 'Gids', datafield: 'style_guide', width: 100, filtertype: 'list' }, |
236 { text: 'Groep', datafield: 'style_letter', width: 30 }, |
236 { text: 'Groep', datafield: 'style_letter', width: 30, filtertype: 'list' }, |
237 { text: 'Style Name', menu: false, datafield: 'name' }, |
237 { text: 'Style Name', menu: false, datafield: 'name', filtertype: 'textbox' }, |
238 { text: 'OG', menu: false, datafield: 'og_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
238 { text: 'OG', menu: false, datafield: 'og_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3', filterable: false }, |
239 { text: 'OG', menu: false, datafield: 'og_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
239 { text: 'OG', menu: false, datafield: 'og_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3', filterable: false }, |
240 { text: 'FG', menu: false, datafield: 'fg_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
240 { text: 'FG', menu: false, datafield: 'fg_min', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3', filterable: false }, |
241 { text: 'FG', menu: false, datafield: 'fg_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3' }, |
241 { text: 'FG', menu: false, datafield: 'fg_max', width: 60, align: 'right', cellsalign: 'right', cellsformat: 'f3', filterable: false }, |
242 { text: 'IBU', menu: false, datafield: 'ibu_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, |
242 { text: 'IBU', menu: false, datafield: 'ibu_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0', filterable: false }, |
243 { text: 'IBU', menu: false, datafield: 'ibu_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, |
243 { text: 'IBU', menu: false, datafield: 'ibu_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0', filterable: false }, |
244 { text: 'EBC', menu: false, datafield: 'color_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, |
244 { text: 'EBC', menu: false, datafield: 'color_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0', filterable: false }, |
245 { text: 'EBC', menu: false, datafield: 'color_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0' }, |
245 { text: 'EBC', menu: false, datafield: 'color_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f0', filterable: false }, |
246 { text: 'Co2', menu: false, datafield: 'carb_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
246 { text: 'Co2', menu: false, datafield: 'carb_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1', filterable: false }, |
247 { text: 'Co2', menu: false, datafield: 'carb_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
247 { text: 'Co2', menu: false, datafield: 'carb_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1', filterable: false }, |
248 { text: 'ABV', menu: false, datafield: 'abv_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
248 { text: 'ABV', menu: false, datafield: 'abv_min', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1', filterable: false }, |
249 { text: 'ABV', menu: false, datafield: 'abv_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
249 { text: 'ABV', menu: false, datafield: 'abv_max', width: 50, align: 'right', cellsalign: 'right', cellsformat: 'f1', filterable: false }, |
250 { text: '', menu: false, datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function() { |
250 { text: '', menu: false, datafield: 'Edit', width: 100, align: 'center', columntype: 'button', filterable: false, cellsrenderer: function() { |
251 return 'Wijzig'; |
251 return 'Wijzig'; |
252 }, buttonclick: function(row) { |
252 }, buttonclick: function(row) { |
253 // open the popup window when the user clicks a button. |
253 // open the popup window when the user clicks a button. |
254 editrow = row; |
254 editrow = row; |
255 // get the clicked row's data and initialize the input fields. |
255 // get the clicked row's data and initialize the input fields. |