I have implemented a function using Sencha touch.
In that i have designed a view with 2 buttons ADD, DELETE in a file in VIEW.
AQnd add corresponding controllers for the button in CONTROLLER file
controller works fine for console out put
But i need to add any one form like textfield or text area of field set, by taping on ADD button dynamically
Delete one form when tap DELETE button dynamically.
View File:
Ext.define('MyApp.view.MainPanel', {
extend: 'Ext.form.Panel',
config: {
items: [
{
xtype: 'button',
id: 'addButton',
height: 33,
left: '',
margin: '500px',
padding: '',
right: '400px',
ui: 'confirm-round',
width: 100,
text: 'Add'
},
{
xtype: 'button',
id: 'deleteButton',
height: 33,
margin: '500px',
right: '296px',
ui: 'decline-round',
width: 100,
text: 'Delete'
}
]
}});
Controller file:
Ext.define('MyApp.controller.MainController', {
extend: 'Ext.app.Controller',
config: {
views: [
'MainPanel'
],
},
init: function() {
this.control({
'#addButton': {
tap: function() {
console.log('Add field');
}
},
'#deleteButton': {
tap: function() {
console.log('Delete field');
}
},
});
},
Output: