Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    11
    Vote Rating
    0
    reco123 is on a distinguished road

      0  

    Default Answered: Touch 2 List loading mask problem !!!!

    Answered: Touch 2 List loading mask problem !!!!


    I have a question about set list masked. Here is my code. I use "masked" to gray out the list before data get loaded. But how can I remove the mask afterward?

    I tried to listen to the event load.. but it never fired.. which event i should listen to ?
    also, I tried to use c.setMasked(false); but it does't work. how can i get the list instance inside the event function?
    Thanks!

    Code:
        var list =     {
          xtype: 'list',
          title: 'Game List',
          id: 'gameList',
          ui: 'round',
          flex: 1,
          width: 300,
          store: 'Games',
          cls: 'gameList',
          masked: {
                    xtype: 'loadmask',
                    message: 'loading data'
                }, // masked
          listeners: {
            painted: function(c) {
                  list.setMasked(false);
            }
          },
          itemTpl: Ext.create('Ext.XTemplate',
           '<div class="game">',
           '<img class="gameuserpic" src="{userPic}" />',
           '<img class="gamemoveimg" src="resources/images/{action}.png"/>',
           '<p class="info">{userName}</p>',
           '<p class="move">{move}</p>',
           '</div>'),
          //end itemTPl
          emptyText: 'Create some new Game!!'
        };

  2. List components will handle the removal of the mask automatically. Here's the snippet from the source of Ext.dataview.Dataview related to that:

    Code:
    onLoad: function(store) {
        //remove any masks on the store
        this.hasLoadedStore = true;
        this.setMasked(false);
    
    
        if (!store.getCount()) {
            this.showEmptyText();
        }
    }
    Your call to setMasked in the painted event failed because the parameter for that event is not a component but the element. Since the list automatically handles the removal of that mask, you don't need that painted event in there anymore.

    Brice

  3. #2
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Answers
    49
    Vote Rating
    43
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    List components will handle the removal of the mask automatically. Here's the snippet from the source of Ext.dataview.Dataview related to that:

    Code:
    onLoad: function(store) {
        //remove any masks on the store
        this.hasLoadedStore = true;
        this.setMasked(false);
    
    
        if (!store.getCount()) {
            this.showEmptyText();
        }
    }
    Your call to setMasked in the painted event failed because the parameter for that event is not a component but the element. Since the list automatically handles the removal of that mask, you don't need that painted event in there anymore.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    11
    Vote Rating
    0
    reco123 is on a distinguished road

      0  

    Default


    It doesn't work. I tried what u said just let it remove the mask automatically... but it never happened ... Is there anyway i can remove it manually?

  5. #4
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Answers
    49
    Vote Rating
    43
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    You can certainly remove it manually however if the automatic removal is not working for you then there's another issue that needs to be worked out. Are there any errors or warnings in your browser console? Do you have a breakpoint set that has stopped processing?

    For full reference, here's the code that I used.

    app.js (launch function):
    Code:
    var list = {
        xtype: 'list',
        title: 'Game List',
        id: 'gameList',
        ui: 'round',
        flex: 1,
        width: 300,
        store: 'Games',
        cls: 'gameList',
        masked: {
            xtype: 'loadmask',
            message: 'loading data'
        }, 
        itemTpl: Ext.create('Ext.XTemplate',
            '<div class="game">',
            '<img class="gameuserpic" src="{userPic}" />',
            '<img class="gamemoveimg" src="resources/images/{action}.png"/>',
            '<p class="info">{userName}</p>',
            '<p class="move">{move}</p>',
            '</div>'),
        emptyText: 'Create some new Game!!'
    };
    
    
    // Initialize the main view
    Ext.Viewport.add(list);
    model:
    Code:
    Ext.define('MyApp.model.Game', {
        extend: 'Ext.data.Model',
        
        config: {
            fields: [
                {name: 'userPic', type: 'string'},
                {name: 'action', type: 'string'},
                {name: 'userName', type: 'string'},
                {name: 'move', type: 'string'}
            ]
        }
    });
    store:
    Code:
    Ext.define('MyApp.store.Games', {
       extend: 'Ext.data.Store',
    
    
       config: {
          storeId: 'Games',
          model: 'MyApp.model.Game',
          proxy: {
             type: 'ajax',
             url: 'data/games.json',
             reader: {
                type: 'json',
                rootProperty: 'games'
             }
          },
          autoLoad: true
       }
    });
    json snippet:
    Code:
    {
       "games": [
          { "userPic": "user-pic1", "action": "action1", "userName": "userName1", "move": "move1" },
          { "userPic": "user-pic2", "action": "action2", "userName": "userName2", "move": "move2" },
          { "userPic": "user-pic3", "action": "action3", "userName": "userName3", "move": "move3" }
       ]
    }
    For the code that you've already posted, you can obtain a reference to that list by doing:

    Code:
    var theList = Ext.getCmp('gameList');
    to get the component which you can then remove the mask.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  6. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    11
    Vote Rating
    0
    reco123 is on a distinguished road

      0  

    Default


    Thank you so much !! i just figured out. i used self-defined populate function to load the data which it never fired load event. Now i did it manually by calling "self.fireEvent("load");" so it works now !

Thread Participants: 1