Results 1 to 3 of 3

Thread: fill Form from store

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    45
    Vote Rating
    0
      0  

    Default Answered: fill Form from store

    Hi, my goal is to fill my form field from a store loading in an MVC application, here is my code from
    my controller:

    PHP Code:
    var myStore Ext.getStore('myStore');
    myStore.getProxy().setExtraParams({id_item'11'});        
    myStore.load({            
        
    callback: function(recordsoperationsuccess) {                
        if (
    success == true) {                                 
        var 
    myModel Ext.create('app.model.Item', {});
        
    myModel.setData(records); // this is the problem
        
    var selmodview this.getSelmodview();                    
        
    Ext.Viewport.animateActiveItem(selmodview, {type'slide'direction'left'});                    
        var 
    mainform this.getMainform(); // this is the form to fill with records
        
    mainform.setRecord(myModel);                                    
      } else {                   
        
    console.log(operation.error.statusText);               
      }           
    },           
    scopethis
    }); 
    the store loading is ok, app.model.Item is defined and gives no error, but the form still remain empty.

  2. Hi wakatanka,

    Try getAt(0) method of store class to get the model instances instead of creating model instance.

    http://docs.sencha.com/touch/2-1/#!/...e-method-getAt

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •