PDA

View Full Version : Multiple Form panels in a container with data from JSON object ?



edmundchow
17 Mar 2011, 2:43 AM
http://i248.photobucket.com/albums/gg184/edmundchow00/sencha%20touch/multiform.png

hi,

Do anyone know how to do this in Sencha Touch ? This is similar to the Linkin IPhone app

I have a JSON store in which I pull out records of people who wants to befriend me and place each individual record in a form. The form will have 2 buttons : accept or reject the befriend request.
Once either button is clicked, the form will update the befriend table and that particular form will disappear and the rest of the form panels will be pushed up to take the place of the disappeared form

I declared my JSON store as such :



Ext.regModel("Befriends", {
fields: [
"requesteeid", // id of the person you want to befriend with
"requesteename",
"status"
]
});

var BefriendsStore = new Ext.data.Store({
model: 'Befriends',
proxy: {
type: 'ajax',
url : 'befriendshow.php',
reader: {
type: 'json',
root: 'results'
}
},
autoLoad: true
});


I was looking at Ext.XTemplate to see if this can be done

mitchellsimoens
17 Mar 2011, 5:16 AM
FormPanel may not be the best component to use here. Why not use DataView and add buttons to each?