PDA

View Full Version : load record method in sencha



mukund1a
15 Nov 2011, 9:23 PM
i have following code
inside controller:

var model1 = this.store.getAt(a.index);
App.views.start.load(model1);
App.views.viewport.reveal('start');
inside the start.js file

App.views.start = Ext.extend(Ext.form.FormPanel, {
initComponent: function(){
fields = {
id: 'data',
title: 'id',
defaults: {
xtype:'textfield'
},
items: [
{
xtype: 'hiddenfield',
name : 'id',
id:'slno'
},
new Ext.util.Droppable('q',{
validDropMode: 'contains',
name : 'q1'//give the data from model
}),
new Ext.util.Draggable('op1',{
name: 'op1',
group:'invalid',
revert:true
})
,
new Ext.util.Draggable('op2',{
name: 'ans',
group:'base',
revert:true
})
]
};
how can i able to get the the various data in console panel .What could be the other way for getting the records? reply plz

mitchellsimoens
18 Nov 2011, 4:02 PM
All you have to do is have your model fields and form fields name properties match and loadRecord should put the data on the fields just fine.

mukund1a
20 Nov 2011, 10:07 PM
Thanks for your reply
my problem is how can i change the xtype insted of text field
App.views.start.load(model1); this passes the model object i need to access it in draggable and dropable component

AndreaCammarata
21 Nov 2011, 2:11 AM
Thanks for your reply
my problem is how can i change the xtype insted of text field
App.views.start.load(model1); this passes the model object i need to access it in draggable and dropable component

Sorry but its not clear what are you trying to achieve.
Why you should change the xtype?
As @Mitchell said, to load all your model fields inside the associated form fields you only need to have the same name on both.

If you are trying to do something different, please give us more informations.

mukund1a
21 Nov 2011, 9:03 PM
i want to get the model instance in the startpage.js file which is load by dispatcher when i use drag and drop in these x type it is rewritable and again if i want to use drag and drop more customized the it required store tpl tplselector etc what would be the store in the start page 29467