0

I have a gui where the use can select different shapes to render with a dropdown. This works well. Now I wanna display a folder with some slider. The count, name and min/max values of the sliders differ in which shape is selected. How can I accomplish this with dat.gui.

Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
  • Folder - do you mean a dom element? On select change you want to add dom elements and update values. You can use onChange event [example](http://workshop.chromeexperiments.com/examples/gui/#7--Events) – uhura Apr 06 '13 at 12:26
  • I mean the DOM element added with `gui.addFolder`. – Andreas Köberle Apr 06 '13 at 12:40
  • Can't you update values on select change? [example how to update](http://workshop.chromeexperiments.com/examples/gui/#10--Updating-the-Display-Manually) – uhura Apr 06 '13 at 14:58

1 Answers1

0

Ok found a solution by adding this to the dat.GUI prototype:

dat.GUI.prototype.removeFolder = function(name) {
  var folder = this.__folders[name];
  if (!folder) {
    return;
  }
  folder.close();
  this.__ul.removeChild(folder.domElement.parentNode);
  delete this.__folders[name];
  this.onResize();
}
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297