1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    India
    Posts
    10
    Vote Rating
    0
    mukund1a is on a distinguished road

      0  

    Exclamation load record method in sencha

    load record method in sencha


    i have following code
    inside controller:
    Code:
    var model1 = this.store.getAt(a.index);
        App.views.start.load(model1);
        App.views.viewport.reveal('start');
    inside the start.js file
    Code:
    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

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,994
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    India
    Posts
    10
    Vote Rating
    0
    mukund1a is on a distinguished road

      0  

    Default


    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

  4. #4
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,394
    Vote Rating
    22
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    Quote Originally Posted by mukund1a View Post
    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.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    CEO at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    http://www.tux-components.com/


  5. #5
    Sencha User
    Join Date
    Oct 2011
    Location
    India
    Posts
    10
    Vote Rating
    0
    mukund1a is on a distinguished road

      0  

    Default


    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