Changeset 9222


Ignore:
Timestamp:
May 30, 2011, 4:21:35 PM (13 years ago)
Author:
dennisw
Message:

Added ID's to options to make chain select possibly easier.

File:
1 edited

Legend:

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

    r9221 r9222  
    6262  var layername = '<input type="text" id="lname" name="lname" size="10"/> Layername<br />';
    6363  var colour = '<input type="text" id="colour" name="colour" size="10"/> Colour<br />';
    64   var user = '<select id="user" style="width:104px"><option></option></select> User<br />';
    65   var dataset = '<select id="dataset" style="width:104px"><option></option></select> Dataset<br />';
    66   var node = '<select id="node" style="width:104px"><option></option></select> Node<br />';
    67   var enc = '<select id="enc" style="width:104px"><option></option></select> Encryption<br />';
    68   var date = '<select id="date" style="width:104px"><option></option></select> Date<br />';
     64  var user = '<select id="user" style="width:104px" onblur="update_filters(this)"><option></option></select> User<br />';
     65  var dataset = '<select id="dataset" style="width:104px" onblur="update_filters(this)"><option></option></select> Dataset<br />';
     66  var node = '<select id="node" style="width:104px" onblur="update_filters(this)"><option></option></select> Node<br />';
     67  var enc = '<select id="enc" style="width:104px" onblur="update_filters(this)"><option></option></select> Encryption<br />';
     68  var date = '<select id="date" style="width:104px" onblur="update_filters(this)"><option></option></select> Date<br />';
    6969
    7070  // Write form to document
     
    9191  var options = '';
    9292  for (var i=0; i<json.length; i++){
    93     options += '<option>' + json[i].fields[field] + '</option>';
     93    if (filter=='dataset'){
     94      options += '<option value="' + json[i].fields.gebruiker + '">' + json[i].fields[field] + '</option>';
     95    }
     96    else{
     97      options += '<option value="' + json[i].pk + '">' + json[i].fields[field] + '</option>';
     98    }
    9499  }
    95100  document.getElementById(filter).innerHTML+=options;
     101}
     102
     103
     104function update_filters(id){
     105  var filtervalue = id.options[id.selectedIndex].value;
     106
    96107}
    97108
Note: See TracChangeset for help on using the changeset viewer.