24 function createDelElements() { |
24 function createDelElements() { |
25 $('#eventWindow').jqxWindow({ |
25 $('#eventWindow').jqxWindow({ |
26 theme: theme, |
26 theme: theme, |
27 position: { x: 490, y: 210 }, |
27 position: { x: 490, y: 210 }, |
28 width: 300, |
28 width: 300, |
29 height: 145, |
29 height: 175, |
30 resizable: false, |
30 resizable: false, |
31 isModal: true, |
31 isModal: true, |
32 modalOpacity: 0.4, |
32 modalOpacity: 0.4, |
33 okButton: $('#delOk'), |
33 okButton: $('#delOk'), |
34 cancelButton: $('#delCancel'), |
34 cancelButton: $('#delCancel'), |
134 theme: theme, |
134 theme: theme, |
135 showstatusbar: true, |
135 showstatusbar: true, |
136 localization: getLocalization(), |
136 localization: getLocalization(), |
137 renderstatusbar: function (statusbar) { |
137 renderstatusbar: function (statusbar) { |
138 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
138 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
139 var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>"); |
139 var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Nieuw</span></div>"); |
140 container.append(addButton); |
140 container.append(addButton); |
141 statusbar.append(container); |
141 statusbar.append(container); |
142 addButton.jqxButton({ width: 60, height: 20 }); |
142 addButton.jqxButton({ theme: theme, width: 120, height: 20 }); |
143 // add new row. |
143 // add new row. |
144 addButton.click(function (event) { |
144 addButton.click(function (event) { |
145 editrow = -1; |
145 editrow = -1; |
146 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); |
146 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); |
147 $("#name").val(''); |
147 $("#name").val(''); |
158 }); |
158 }); |
159 }, |
159 }, |
160 filterable: true, |
160 filterable: true, |
161 filtermode: 'excel', |
161 filtermode: 'excel', |
162 columns: [ |
162 columns: [ |
163 { text: 'Water Profile', datafield: 'name', width: 250 }, |
163 { text: 'Water Profiel', datafield: 'name', width: 250 }, |
164 { text: 'Notes', datafield: 'notes', width: 450 }, |
164 { text: 'Opmerkingen', datafield: 'notes', width: 475 }, |
165 { text: 'Natrium', datafield: 'sodium', width: 80, cellsalign: 'right', cellsformat: 'f1' }, |
165 { text: 'Natrium', datafield: 'sodium', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
166 { text: 'Chloride', datafield: 'chloride', width: 80, cellsalign: 'right', cellsformat: 'f1' }, |
166 { text: 'Chloride', datafield: 'chloride', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
167 { text: 'Sulfaat', datafield: 'sulfate', width: 80, cellsalign: 'right', cellsformat: 'f1' }, |
167 { text: 'Sulfaat', datafield: 'sulfate', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
168 { text: 'Zuurgraad', datafield: 'ph', width: 80, cellsalign: 'right', cellsformat: 'f1' }, |
168 { text: 'Zuurgraad', datafield: 'ph', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
169 { text: 'alkaliteit', datafield: 'total_alkalinity', width: 80, cellsalign: 'right', cellsformat: 'f1' }, |
169 { text: 'Alkaliteit', datafield: 'total_alkalinity', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, |
170 { text: 'Edit', datafield: 'Edit', columntype: 'button', cellsrenderer: function () { |
170 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', cellsrenderer: function () { |
171 return "Edit"; |
171 return "Wijzig"; |
172 }, buttonclick: function (row) { |
172 }, buttonclick: function (row) { |
173 // open the popup window when the user clicks a button. |
173 // open the popup window when the user clicks a button. |
174 editrow = row; |
174 editrow = row; |
175 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); |
175 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); |
176 // get the clicked row's data and initialize the input fields. |
176 // get the clicked row's data and initialize the input fields. |