PDA

View Full Version : Value from textarea to JSON



neosky
4 Dec 2013, 11:15 PM
hello i have a form with grid (id, year, author) and a child form with TEXTAREA (there enter name of author ) and button and JSON

json={"bookId":1,"author":"2","options":[{"author":"NAME","value":"3"},{"author":"american","value":"4"}]}

and i want: on click button text in textarea send to my JSON on "NAME".


authorBook: function(button) {
var win = button.up('window');
var grid = win.getGrid();
var rowIndex = win.getRowIndex();
store = grid.store;
var a= grid.getStore().getAt(rowIndex);
var request = {

what i write on request ? thanks

scottmartin
5 Dec 2013, 7:32 AM
Use Ext.merge()



Ext.application({
name : 'Fiddle',

launch : function() {

var extjs = {
companyName: 'Ext JS',
products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
isSuperCool: true,
office: {
size: 2000,
location: 'Palo Alto',
isFun: true
}
};

console.log(Ext.encode(extjs));

var newStuff = {
companyName: 'Sencha Inc.',
products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
office: {
size: 40000,
location: 'Redwood City'
}
};

var sencha = Ext.Object.merge(extjs, newStuff);

console.log(Ext.encode(extjs));

}
});