GUI Components JavaScript DHTML



DynAPI Examples - List


dynapi.library.setPath('./dynapisrc/')
dynapi.library.include('dynapi.api')
dynapi.library.include('dynapi.api.ext.DragEvent')
dynapi.library.include('dynapi.gui.NodeItem')
dynapi.library.include('dynapi.gui.Tree')


  var file=dynapi.functions.getImage("./dynapiexamples/images/file.gif");
  var Draglayer = new DynLayer(file.getHTML(),220,20);
  Draglayer.setHTML("
"+file.getHTML()+"
D&D Layer
");
  tree = new Tree(true)
  tree.setLocation(350,20);
  tree.setWidth(250);
  tree.boldOnSelect(true);
  tree.itemsResize(false,true);
  tree.add("root",1,"Content1","value1");
  tree.add("root",2,"Content2","value2");
  tree.add("root",3,"Content3","value3");
    tree.add(3,31,"Content4","value4");
    tree.add(3,32,"Content5","value5");
    tree.add(3,33,"Content6","value6");
    tree.add(3,34,"Content7","value7");
  tree.add("root",4,"Content8","value8");
    tree.add(4,41,"Content9","value9");
      tree.add(41,441,"Content10","value10");
  tree.add("root",5,"Content8","value11");
    tree.add(5,51,"Content9","value12");
      tree.add(51,551,"Content10","value13");
  Draglayer.setZIndex(100);
  DragEvent.enableDragEvents(Draglayer);
  var mylistener={
  ondrop:function(e)
    {
      var o=e.getSource();
      alert(o.getValue());
    }
  }
  tree.addItemEventListener(mylistener);
  dynapi.document.addChild(Draglayer);
  dynapi.document.addChild(tree);
  var icon = new DynLayer('',0,0,20,24);
  icon.setMinimumSize(20,24);
  icon.setMaximumSize(20,24);
  for(var i in tree.items) {
    if(i!=tree.root_name)
    {
      tree.items[i].node.setDragEnabled(true,null,true);
      tree.items[i].node.setDragIcon(icon);
    }
  }





Set Width: 150, 250, 350

Set Mode: Multi, Single

Remove selected item

Set Borders: 0,  1, 3

Set Spacing: 0,  1, 3

Get Selected:

Index

Item

Indexes (Multi only)



Items auto resize on

Items auto resize off


           
         
  
dynapi.zip( 791 k)