JSFiddle - React, Tailwind, and code Playground

by delebash

HTML

<script src="http://docs.sencha.com/extjs/4.1.3/extjs-build/ext-all.js"></script>
<link rel="stylesheet" href="http://docs.sencha.com/extjs/4.1.3/extjs-build/resources/css/ext-all.css">

JavaScript

Ext.define('User', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'first', type: 'string'},
        {name: 'last', type: 'string'}
    ]
});

Ext.onReady(function(){
    var record = Ext.create('User', { first : 'Tom', last : 'Smith'})
      var win = Ext.create( 'Ext.window.Window' , {
            title: 'Hello Sencha',
            height: 285,
            width: 250,
            layout: 'fit',
          
            items: {
              xtype: 'form',
      title: 'Simple Form',
      trackResetOnLoad: true,
      bodyPadding: 5,
      width: 350,
      layout: 'anchor',
      defaults: {
          anchor: '100%'
      },
      defaultType: 'textfield',
      items: [{
          fieldLabel: 'First Name',
          name: 'first'
      },{
          fieldLabel: 'Last Name',
          name: 'last'
      }],
      renderTo: Ext.getBody(),
      listeners: {
        change: function(myfield, newvalue, oldvalue, eopts) {
            debugger;
     //     b ? Ext.getCmp('check-btn').enable() : //Ext.getCmp('check-btn').disable();
        }
      },
      buttons: [{
        text:'check',
        id: 'check-btn',
        disabled: true,
        handler: function(btn) {
        	if (btn.up('form').isDirty())
              alert('I am dirty!');
        }
      }]
            },
 
          })
          //show the window
          win.show()
          win.down('form').loadRecord(record);  
        })