166 statusbar.append(container); |
166 statusbar.append(container); |
167 addButton.jqxButton({ theme: theme, width: 120, height: 20 }); |
167 addButton.jqxButton({ theme: theme, width: 120, height: 20 }); |
168 // add new row. |
168 // add new row. |
169 addButton.click(function (event) { |
169 addButton.click(function (event) { |
170 editrow = -1; |
170 editrow = -1; |
171 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); |
171 $("#popupWindow").jqxWindow({ position: { x: 130, y: 20 } }); |
172 $("#name").val(''); |
172 $("#name").val(''); |
173 $("#category").val(''); |
173 $("#category").val(''); |
174 $("#category_number").val(''); |
174 $("#category_number").val(''); |
175 $("#style_letter").val(''); |
175 $("#style_letter").val(''); |
176 $("#style_guide").val(''); |
176 $("#style_guide").val(''); |
214 { text: 'Wijzig', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () { |
214 { text: 'Wijzig', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () { |
215 return "Wijzig"; |
215 return "Wijzig"; |
216 }, buttonclick: function (row) { |
216 }, buttonclick: function (row) { |
217 // open the popup window when the user clicks a button. |
217 // open the popup window when the user clicks a button. |
218 editrow = row; |
218 editrow = row; |
219 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); |
219 $("#popupWindow").jqxWindow({ position: { x: 130, y: 20 } }); |
220 // get the clicked row's data and initialize the input fields. |
220 // get the clicked row's data and initialize the input fields. |
221 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
221 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
222 $("#name").val(dataRecord.name); |
222 $("#name").val(dataRecord.name); |
223 $("#category").val(dataRecord.category); |
223 $("#category").val(dataRecord.category); |
224 $("#category_number").val(dataRecord.category_number); |
224 $("#category_number").val(dataRecord.category_number); |
247 } |
247 } |
248 ] |
248 ] |
249 }); |
249 }); |
250 // initialize the popup window and buttons. |
250 // initialize the popup window and buttons. |
251 $("#popupWindow").jqxWindow({ |
251 $("#popupWindow").jqxWindow({ |
252 width: 860, resizable: false, theme: theme, isModal: true, autoOpen: false, cancelButton: $("#Cancel"), modalOpacity: 0.40 |
252 width: 960, resizable: false, theme: theme, isModal: true, autoOpen: false, cancelButton: $("#Cancel"), modalOpacity: 0.40 |
253 }); |
253 }); |
254 $("#popupWindow").on('open', function () { |
254 $("#popupWindow").on('open', function () { |
255 $("#name").jqxInput('selectAll'); |
255 $("#name").jqxInput('selectAll'); |
256 }); |
256 }); |
257 $("#Delete").jqxButton({ theme: theme }); |
257 $("#Delete").jqxButton({ theme: theme }); |