Ignore:
Timestamp:
Jun 6, 2011, 8:22:23 PM (13 years ago)
Author:
dennisw
Message:

Undid some stuff again. Filters work again, but no dependant dropdown boxes. This makes it possible to create otherwise impossible filters (e.g. user='John' & dataset='test', while 'test' actually belongs to Jane).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/website/static/heatmap_extensions_test.js

    r9232 r9233  
    6161  var layername = '<input type="text" id="lname" name="lname" size="10"/> Layername<br />';
    6262  var colour = '<input type="text" id="colour" name="colour" size="10"/> Colour<br />';
    63   var user = '<select id="user" style="width:104px" onchange=filter_user()></select> User<br />';
    64   var dataset = '<select id="dataset" style="width:104px" onchange=filter_node()></select> Dataset<br />';
    65   var node = '<select id="node" style="width:104px" onchange=update_filters(this.id)></select> Node<br />';
     63  var user = '<select id="user" style="width:104px"></select> User<br />';
     64  var dataset = '<select id="dataset" style="width:104px"></select> Dataset<br />';
     65  var node = '<select id="node" style="width:104px"></select> Node<br />';
    6666  var enc = '<select id="enc" style="width:104px"></select> Encryption<br />';
    67   var date = '<select id="date" style="width:104px" onchange=filter_date()></select> Date<br />';
     67  var date = '<select id="date" style="width:104px"></select> Date<br />';
    6868
    6969  // Write form to document
     
    7979function set_filters(responseText) {
    8080  json=eval('(' + responseText + ')');
    81   var user = '<option>Select user</option><option>All</option>';
    82   var dataset = '<option>Select dataset</option><option>All</option>';
    83   var date = '<option>Select date</option><option>All</option>';
    84   var node = '<option>Select node</option><option>All</option>';
     81  var user = '<option>All</option>';
     82  var dataset = '<option>All</option>';
     83  var date = '<option>All</option>';
     84  var node = '<option>All</option>';
    8585  for (var i=0; i<json.length; i++){
    8686    user += '<option>' + json[i].gebruiker + '</option>';
     
    104104  var user = $('#user option:selected').text();
    105105  var dataset = $('#dataset option:selected').text();
    106   var wlnode = $('#wlnode option:selected').text();
     106  var wlnode = $('#node option:selected').text();
    107107  var enc = $('#enc option:selected').text();
    108108  var date = $('#date option:selected').text();
     
    110110  var lname = encodeURIComponent(document.getElementById("lname").value);
    111111
    112   if ((user != 'Select user') && (user != 'All')){user='&meetrondje__gebruiker__naam='+user;}
     112  if (user != 'All'){user='&meetrondje__gebruiker__naam='+user;}
    113113  else{user='';}
    114   if ((dataset != 'Select dataset') && (dataset != 'All')){dataset='&meetrondje__naam='+dataset;}
     114  if (dataset != 'All'){dataset='&meetrondje__naam='+dataset;}
    115115  else{dataset='';}
    116   if ((wlnode != 'Select node') && (dataset != 'All')){wlnode='&accespoint__ssid='+wlnode;}
     116  if (wlnode != 'All'){wlnode='&accespoint__ssid='+wlnode;}
    117117  else{wlnode='';}
    118118  if (enc != ''){enc='&accespoint__encryptie='+enc;}
    119   if ((date != 'Select date') && (date != 'All')){date='&meetrondje__datum='+date;}
     119  if (date != 'All'){date='&meetrondje__datum='+date;}
    120120  else{date='';}
    121121  if (colour != ''){colour='colour='+colour;}
Note: See TracChangeset for help on using the changeset viewer.