Dictionary value iterator : Dictionary « Dojo toolkit « JavaScript DHTML






Dictionary value iterator

 
<html>
  <head>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojox.collections.Dictionary");

      function testIt() {
        var dy = new dojox.collections.Dictionary();
        dy.add("A", "a");
        dy.add("B", "b");
        dy.add("Q", "q");
        dy.add("R", "r");
        
        var vals = dy.getValueList();
        for (var i = 0; i < vals.length; i++) {
          alert( vals[i]);
        }
      }
    </script>
  </head>
  <body onLoad="testIt();">
  </body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Clear a dictionary
2.Dictionary key iterator
3.Dictionary.Entry
4.Dictionary.containsKey
5.Dictionary.containsValue
6.Dictionary.count
7.Get Iterator from dictionary
8.Remove entry from Dictionary
9.Create a dictionary