19 * along with ThermFerm; see the file COPYING. If not, write to the Free |
19 * along with ThermFerm; see the file COPYING. If not, write to the Free |
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
21 *****************************************************************************/ |
21 *****************************************************************************/ |
22 |
22 |
23 |
23 |
|
24 |
24 function createDelElements() { |
25 function createDelElements() { |
25 $('#eventWindow').jqxWindow({ |
26 $('#eventWindow').jqxWindow({ |
26 theme: theme, |
27 theme: theme, |
27 position: { x: 355, y: 210 }, |
28 position: { x: 490, y: 210 }, |
28 width: 270, |
29 width: 300, |
|
30 height: 145, |
29 resizable: false, |
31 resizable: false, |
30 isModal: true, |
32 isModal: true, |
31 modalOpacity: 0.4, |
33 modalOpacity: 0.4, |
32 okButton: $('#delOk'), |
34 okButton: $('#delOk'), |
33 cancelButton: $('#delCancel'), |
35 cancelButton: $('#delCancel'), |
34 initContent: function () { |
36 initContent: function () { |
35 $('#delOk').jqxButton({ width: '65px', theme: theme }); |
37 $('#delOk').jqxButton({ width: '65px', theme: theme }); |
36 $('#delCancel').jqxButton({ width: '65px', theme: theme }); |
38 $('#delCancel').jqxButton({ width: '65px', theme: theme }); |
37 $('#delCancel').focus(); |
39 $('#delCancel').focus(); |
38 } |
40 } |
39 }); |
41 }); |
40 $('#eventWindow').jqxWindow('hide'); |
42 $('#eventWindow').jqxWindow('hide'); |
41 } |
43 } |
|
44 |
42 |
45 |
43 |
46 |
44 $(document).ready(function () { |
47 $(document).ready(function () { |
45 var url = "includes/db_inventory_suppliers.php"; |
48 var url = "includes/db_inventory_suppliers.php"; |
46 // prepare the data |
49 // prepare the data |
123 |
126 |
124 var dataAdapter = new $.jqx.dataAdapter(source); |
127 var dataAdapter = new $.jqx.dataAdapter(source); |
125 var editrow = -1; |
128 var editrow = -1; |
126 // initialize jqxGrid |
129 // initialize jqxGrid |
127 $("#jqxgrid").jqxGrid({ |
130 $("#jqxgrid").jqxGrid({ |
128 width: 980, |
131 width: 1280, |
|
132 height: 630, |
129 source: dataAdapter, |
133 source: dataAdapter, |
130 theme: theme, |
134 theme: theme, |
131 showstatusbar: true, |
135 showstatusbar: true, |
132 renderstatusbar: function (statusbar) { |
136 renderstatusbar: function (statusbar) { |
133 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
137 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
136 statusbar.append(container); |
140 statusbar.append(container); |
137 addButton.jqxButton({ width: 60, height: 20 }); |
141 addButton.jqxButton({ width: 60, height: 20 }); |
138 // add new row. |
142 // add new row. |
139 addButton.click(function (event) { |
143 addButton.click(function (event) { |
140 editrow = -1; |
144 editrow = -1; |
141 $("#popupWindow").jqxWindow({ position: { x: 80, y: 10 } }); |
145 $("#popupWindow").jqxWindow({ position: { x: 230, y: 10 } }); |
142 $("#name").val(''); |
146 $("#name").val(''); |
143 $("#address").val(''); |
147 $("#address").val(''); |
144 $("#city").val(''); |
148 $("#city").val(''); |
145 $("#zip").val(''); |
149 $("#zip").val(''); |
146 $("#country").val(''); |
150 $("#country").val(''); |
152 }); |
156 }); |
153 }, |
157 }, |
154 filterable: true, |
158 filterable: true, |
155 filtermode: 'excel', |
159 filtermode: 'excel', |
156 columns: [ |
160 columns: [ |
157 { text: 'Supplier Name', datafield: 'name', width: 250 }, |
161 { text: 'Leverancier naam', datafield: 'name', width: 250 }, |
158 { text: 'City', datafield: 'city', width: 250 }, |
162 { text: 'Adres', datafield: 'address', width: 300 }, |
159 { text: 'Country', datafield: 'country', width: 250 }, |
163 { text: 'Plaats', datafield: 'city', width: 250 }, |
160 { text: 'Phone', datafield: 'phone', width: 100 }, |
164 { text: 'Land', datafield: 'country', width: 250 }, |
161 { text: 'Edit', datafield: 'Edit', columntype: 'button', cellsrenderer: function () { |
165 { text: 'Telefoon', datafield: 'phone', width: 100 }, |
|
166 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', cellsrenderer: function () { |
162 return "Edit"; |
167 return "Edit"; |
163 }, buttonclick: function (row) { |
168 }, buttonclick: function (row) { |
164 // open the popup window when the user clicks a button. |
169 // open the popup window when the user clicks a button. |
165 editrow = row; |
170 editrow = row; |
166 $("#popupWindow").jqxWindow({ position: { x: 80, y: 10 } }); |
171 $("#popupWindow").jqxWindow({ position: { x: 230, y: 10 } }); |
167 // get the clicked row's data and initialize the input fields. |
172 // get the clicked row's data and initialize the input fields. |
168 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
173 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); |
169 $("#name").val(dataRecord.name); |
174 $("#name").val(dataRecord.name); |
170 $("#address").val(dataRecord.address); |
175 $("#address").val(dataRecord.address); |
171 $("#city").val(dataRecord.city); |
176 $("#city").val(dataRecord.city); |