www/js/profile_fermentation.js

changeset 701
3ce3df681be0
parent 689
499c4921a90f
child 702
f0896a6f9b64
--- a/www/js/profile_fermentation.js	Thu Jun 11 19:59:30 2020 +0200
+++ b/www/js/profile_fermentation.js	Sat Jun 13 12:14:26 2020 +0200
@@ -79,9 +79,7 @@
      commit(true);
      location.reload(true);
     },
-    error: function(jqXHR, textStatus, errorThrown) {
-     commit(false);
-    }
+    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
    });
   },
   addrow: function(rowid, rowdata, position, commit) {
@@ -96,9 +94,7 @@
      commit(true);
      location.reload(true);
     },
-    error: function(jqXHR, textStatus, errorThrown) {
-     commit(false);
-    }
+    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
    });
   },
   updaterow: function(rowid, rowdata, commit) {
@@ -113,9 +109,7 @@
      commit(true);
      location.reload(true);
     },
-    error: function(jqXHR, textStatus, errorThrown) {
-     commit(false);
-    }
+    error: function(jqXHR, textStatus, errorThrown) { commit(false); }
    });
   }
  },
@@ -228,6 +222,9 @@
  $('#inittemp_hi').jqxNumberInput({ max: 45 });
  $('#fridgemode').jqxCheckBox({ theme: theme, height: 23, enableContainerClick: false });
 
+ var  localizationobj = {};
+ localizationobj.filterchoosestring= "Keuze:";
+
  // initialize jqxGrid
  $('#jqxgrid').jqxGrid({
   width: 1280,
@@ -238,10 +235,10 @@
   renderstatusbar: function(statusbar) {
    var container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>');
    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>');
+     'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -4px;">Nieuw</span></div>');
    container.append(addButton);
    statusbar.append(container);
-   addButton.jqxButton({ theme: theme, width: 90, height: 20 });
+   addButton.jqxButton({ theme: theme, width: 90, height: 17 });
    // add new row.
    addButton.click(function(event) {
     editrow = -1;
@@ -256,12 +253,16 @@
     $('#popupWindow').jqxWindow('open');
    });
   },
-  filterable: false,
+  ready: function () {
+   $("#jqxgrid").jqxGrid('localizestrings', localizationobj);
+  },
+  filterable: true,
+  showfilterrow: true,
   columns: [
-   { text: 'Vergisting profiel', datafield: 'name' },
-   { text: 'Min. start &deg;C', datafield: 'inittemp_lo', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-   { text: 'Max. start &deg;C', datafield: 'inittemp_hi', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
-   { text: 'Sensor', datafield: 'fridgemode', align: 'right', width: 80,
+   { text: 'Vergisting profiel', datafield: 'name', filtertype: 'textbox' },
+   { text: 'Min. start &deg;C', datafield: 'inittemp_lo', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f1', filtertype: 'number' },
+   { text: 'Max. start &deg;C', datafield: 'inittemp_hi', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f1', filtertype: 'number' },
+   { text: 'Sensor', datafield: 'fridgemode', align: 'right', width: 80, filterable: false,
      cellsrenderer: function(row, columnfield, value, defaulthtml, column) {
       if (value == 0)
        return '<span style="margin: 3px; margin-top: 6px; float: right;">Bier</span>';
@@ -269,8 +270,8 @@
        return '<span style="margin: 3px; margin-top: 6px; float: right;">Koelkast</span>';
      }
    },
-   { text: 'Stappen', datafield: 'totalsteps', width: 80, align: 'right', cellsalign: 'right' },
-   { text: 'Tijdsduur', datafield: 'duration', width: 150, align: 'right',
+   { text: 'Stappen', datafield: 'totalsteps', width: 80, align: 'right', cellsalign: 'right', filterable: false },
+   { text: 'Tijdsduur', datafield: 'duration', width: 150, align: 'right', filterable: false,
      cellsrenderer: function(row, columnfield, value, defaulthtml, column) {
       var show, days, hours;
       if (value < 24) {
@@ -286,7 +287,7 @@
       return '<span style="margin: 3px; margin-top: 6px; float: right;">' + show + '</span>';
      }
    },
-   { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer:
+   { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', filterable: false, cellsrenderer:
     function() {
      return 'Wijzig';
     }, buttonclick: function(row) {

mercurial