1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    10
    Vote Rating
    0
    Gayathiri is on a distinguished road

      0  

    Default Unanswered: EXTJS MVC sending data from one view to another

    Unanswered: EXTJS MVC sending data from one view to another


    Am developing application using EXTJS MVC Architecture. I have created a dataview which consists of the list of users in the system, and each item in the dataview consists of three buttons. One of them is the edit button, which on clicking opens another view. This view consists of a form where the users details can be edited. Now, what am struck in is, when i open the form, i want the users details to be loaded into the fields of the form.
    So, how do i send the data from the dataview to the form so that the appropriate data, respective to the user gets loaded?
    Here is the code:
    Controller
    Code:
    init : function() {
        this.control({
            'button[action=addUsers ]' : {
                click : this.addUsers
            },
            '#userlist' : {
                itemclick : this.userListSelectionChange
            }
        })
    },
    userListSelectionChange : function(view, record, h, ind, evt) {
    
        console.log('user List clicked')
    
        var edit = evt.getTarget('a.icon-edit-32');
        var deletebt = evt.getTarget('a.icon-delete-32');
    
        if (edit != null) {
    
            var name = record.get('Name');
            console.log(name);
    
            this.showHWindow(record);
        }
    
        if (deletebt != null) {
    
            var name = record.get('Name');
            console.log(name);
    
            this.showOffWindow();
        }
    },
    When the showHWindow() method is called, the form opens, and i want the form to be loaded with the data for that particular user. And, even though its printing the correct name for

    Code:
    var name = record.get('Name');
    Am not sure how to send this data to the form.

    mvc extjs extjs4 extjs4.1 extjs-mvc

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,627
    Answers
    612
    Vote Rating
    399
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You can just load the selected record into the form like:

    form.loadRecord(record); // selected record from selection

    Scott.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar