Posts

Showing posts with the label add

ExtJs4 : Dynamically Add Columns

Cod Snippet for Dynamically Adding Columns to a grid panel in Extjs4 Ext.create('Ext.data.Store', { storeId:'simpsonsStore', fields:['name', 'email', 'phone'], data:{'items':[ { 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" }, { 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" }, { 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" }, { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); Ext.create('Ext.grid.Panel', { i...

Dynamically add form elements in Extjs 4

Code snippet to dynamically add form elements in Extjs 4 with ease. Ext.onReady(function() {     var myForm = Ext.create('Ext.form.Panel', {         title: 'Query form',         width: 600,         renderTo: Ext.getBody(),         items: [{             xtype: 'button',             text: 'click me to add',             handler: function() {                 var tf = Ext.create('Ext.form.field.Text', {                     name: 'name',           ...