ExtJs之Ext.util.MixedCollection

时间:2023-03-08 16:59:06
<!DOCTYPE html>
<html>
<head>
    <title>ExtJs</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  		<link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
      <script type="text/javascript" src="ExtJs/ext-all.js"></script>
      <script type="text/javascript" src="ExtJs/bootstrap.js"></script>
      <script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function() {
  var item = new Ext.util.MixedCollection();
  item.on('add', function(index, o, key){
    Ext.Msg.alert('notice', '当前有对象加入,加入后的index是:' + index + '该对象的name是: ' +
    o.name + '加入对应的key是:' + key);
  });
  item.add('obj2key', {name: 'nobj2name'});
});
</script>
</body>
</html>

  ExtJs之Ext.util.MixedCollection