Fork me on GitHub

Example: Basic object creation

How to create a object.

Basic ObjectField creation

Use the following code to create a basic inputEx ObjectField.

HTML

<div id="field-container"></div>

JavaScript

Implementation

YUI().use('inputex-object', 'json', function(Y) {
   


         var f = new Y.inputEx.ObjectField({parentEl: 'container1', showMsg: true});
         
         var el = Y.one('#container1')._node;
         var logDiv = Y.inputEx.cn('div', null, null, "Log :"); 
      el.appendChild(logDiv); 
      f.on("updated",function(value) { 
          logDiv.innerHTML += "Updated at "+(new Date())+" with value: "+Y.JSON.stringify(value)+"<br />"; 
      });


});