-
15 Nov 2011 9:23 PM #1
load record method in sencha
load record method in sencha
i have following code
inside controller:
inside the start.js fileCode:var model1 = this.store.getAt(a.index); App.views.start.load(model1); App.views.viewport.reveal('start');
how can i able to get the the various data in console panel .What could be the other way for getting the records? reply plzCode: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 }) ] };
-
18 Nov 2011 4:02 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
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.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Nov 2011 10:07 PM #3
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
-
21 Nov 2011 2:11 AM #4
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.Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
21 Nov 2011 9:03 PM #5
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 untitled.PNG


Reply With Quote