zoukankan      html  css  js  c++  java
  • 从零开始学习Sencha Touch MVC应用之十八

    建立一个新的控制器以处理新闻(NewsController.js):

    Ext.regController('News', {
      
        // index action
        index: function(options)
        {
            if ( ! this.indexView)
            {
                this.indexView = this.render({
                    xtype: 'NewsIndex',
                });
            }
      
            var backBtn = this.application.viewport.query('#backBtn')[0];
            backBtn.show();
      
            backBtn.setHandler(function()
            {
                Ext.dispatch({
                    controller: 'Home',
                    action: 'index',
                    historyUrl: 'Home/index',
                    //
                    animation: {
                        type: 'slide',
                        reverse: true,
                    },
                });
            });
      
            this.application.viewport.setActiveItem(this.indexView, options.animation);
        },
    });


    现在新闻控制其索引视图为(NewsIndexView.js):

    App.views.NewsIndex = Ext.extend(Ext.List, {
        store: 'NewsItems',
        itemTpl: '{title}, <span class="date">{date}</date>',
    });
    Ext.reg('NewsIndex', App.views.NewsIndex);


    正像我们前面所见,我们已经采用了 Ext.List 组件来显示新闻.
  • 相关阅读:
    向IPython Notebook中导入.py文件
    python--时间日期
    python--条件和循环
    python--输入输出
    python--字符串
    python--内置函数
    python--异常
    python--模块
    python--数据结构
    pybrain
  • 原文地址:https://www.cnblogs.com/fyq891014/p/4188890.html
Copyright © 2011-2022 走看看