标签: extjs-mvc

在ExtJS 4 MVC中将多个视图附加到控制器

这是使用标准的ExtJS 4 MVC库和结构.

我试图将多个视图附加到单个控制器,以便稍后我可以创建它们的实例以添加到面板.不幸的是,当我添加第二个时,我收到有关视图的错误,并且ExtJS阻止了它出现的语法错误,因此我无法查看问题所在.

如果我从下面的列表中注释掉ViewOrders它工作正常,但如果它在那里,那么我得到以下错误:

An uncaught error was raised with the following data: ext-all-debug-with-comments.js (line 7864)
msg:
"The following classes are not declared even if their files have been loaded:   'PVAL_App.view.ViewOrders'. Please check the source code of their corresponding files for possible typos: 'app/view/ViewOrders.js'"

sourceClass: "Ext.Loader"
sourceMethod: "onFileLoaded"
Run Code Online (Sandbox Code Playgroud)

这是我的控制器:

Ext.define('PVAL_App.controller.Viewport', {
    extend: 'Ext.app.Controller',

    views: [
      'Viewport', 'ViewOrders'
    ],

    init: function() {
      console.log('Viewport controller init()');
    }
});
Run Code Online (Sandbox Code Playgroud)

这是我的ViewOrders视图:

Ext.define('PVAL_APP.view.ViewOrder', {

    /* Begin Definitions */
    extend: 'Ext.panel.Panel',
    alias: 'widget.ViewOrders',

    requires: [ …
Run Code Online (Sandbox Code Playgroud)

model-view-controller extjs4 extjs-mvc

1
推荐指数
1
解决办法
5699
查看次数

1
推荐指数
1
解决办法
2599
查看次数

extjs4用图像问题替换按钮

所以我正在尝试用图像替换extjs按钮并让它显示一些工具提示.问题是我只想显示图像,我不想要extjs按钮的背景.这是我的代码如下.为了了解我在说什么,这里是js小提琴:http: //jsfiddle.net/nCkZN/7/

CSS:

.question {
    background-image: url(../www/css/slate/btn/question.png) !important;
    background-repeat: no-repeat;
}
Run Code Online (Sandbox Code Playgroud)

使用Javascript:

{
    xtype: 'button',
    iconCls: 'question',
    tooltip: "<b>read-only</b>:Read-only users will have read only access to all pages<br> ",
    padding: '2 6 2 7',
    width: 20,
    height: 24
}
Run Code Online (Sandbox Code Playgroud)

编辑:我用文本替换了按钮,只显示图像.但它并没有显示工具提示.

{
    xtype: 'text',
    cls: 'question',
    tooltip: "<b>read-only</b>:Read-only users will have read only access to all pagess ",
    height: 20,
    padding: '12 6 2 7'
}
Run Code Online (Sandbox Code Playgroud)

javascript extjs extjs-mvc extjs4.1

1
推荐指数
1
解决办法
6608
查看次数

ExtJs MVC在控制器中放置一个按钮处理程序

在ExtJs MVC中有没有办法在控制器中放置一个按钮处理程序,如下所示:

this.control({
    'storage_settings button[action=submit_settings]': {
     handler: this.submit_settings_handler
  })
Run Code Online (Sandbox Code Playgroud)

或者我是否必须使用其他类似click活动的东西?

javascript extjs dom-events extjs4 extjs-mvc

1
推荐指数
1
解决办法
3471
查看次数

Extjs4设置底部边框false

我有一个表格,我需要将底部边框设置为false.但我无法做到这一点.而且不知道该怎么做.有人可以帮我这个吗?!这是我的代码如下:

Ext.define('Ext4Example.view.sme.Smeform' ,{
extend: 'Ext.form.Panel',
alias : 'widget.smeform',
title: '<div style="text-align:center;">Basic Info</div>',
bodyPadding : '10 10 0 10',
bottomBorder: false,
Run Code Online (Sandbox Code Playgroud)

extjs extjs4 extjs-mvc

1
推荐指数
1
解决办法
7944
查看次数

设置列extjs的默认值

在这里,我在网格中有一些列,我想在'receivedquantity'字段中给出默认值,默认情况下,收到的数量字段将等于"Quantity"字段.如果用户编辑该字段,那么数据将来自数据库我在这里使用mvc模式......

this.columns=
    [
    {
    header:'name',
    dataIndex:'name'},
    {
    header:'Quantity',
    dataIndex:'quantity',
    },
    {
    header:'Received Quantity',
        dataIndex:'receivedquantity',
        selectOnFocus: true,
        filterable:true,
        renderer:function(val, meta, record){
        var receivedquantity = record.data.receivedquantity;
var quantity=record.data.quantity;
        if(receivedquantity==0)//by default receivedquantity=0
        {
        //set (receivequantity=quantity) in the grid's received quantity cell 
        }},
     editor: {allowBlank:false
     }
            }
                ];
Run Code Online (Sandbox Code Playgroud)

extjs extjs-mvc

1
推荐指数
1
解决办法
4881
查看次数

在extjs MVC架构中如何将参数传递给函数

我想将参数"aaa"传递给disableFlied函数,但下面的代码不起作用:

init: function() {

    this.control({
        '#speedCheck': {
            change :this.disableFlied("aaa")
        }
    });

},
disableFlied: function(cmpName){

    var a = Ext.getCmp(cmpName);
    a.setDisabled(!a.isDisabled());

}
Run Code Online (Sandbox Code Playgroud)

如何将"aaa"传递给disableFlied函数?

extjs extjs4 extjs-mvc

1
推荐指数
1
解决办法
1413
查看次数

ExtJs使用动画闪烁DisplayField

下午大家,

我有一个显示区域,我想为它实现一个恒定的闪烁动画.我仍然是ExtJs的新手,也是动画片的新品牌.我已经把我在互联网上找到的一些代码放在一起了.我猜它正在做某事,因为文字不再可见.我只是需要帮助调整它来制作一个闪烁的动画.谢谢.

{ xtype: 'displayfield', itemId:'txtTest', width:165, value:'Test' }

var p = sender.down('#txtTest');
p.animate({
   duration: 100,
    to: {
        opacity: 0
    }
});
Run Code Online (Sandbox Code Playgroud)

animation extjs extjs-mvc

1
推荐指数
1
解决办法
880
查看次数

参考自动实例化的Sencha Touch 2视图

我想从我的Sencha Touch 2控制器中获取我的视图参考,它看起来像这样(CoffeeScript):

Ext.define 'MyApp.view.Books',
    extend: 'Ext.Panel'
    id: 'books'
    config:
        html: 'Hello, Books!'
Ext.define 'MyApp.controller.Books',
    extend: 'Ext.app.Controller'
    views: [
        'Books'
    ]
    init: ->
        @control
            '#books':
                render: ->
                    console.log 'This is never called. Why?'
                show: ->
                    console.log 'This is called twice.'
                    # @getBooksView() is not a view instance, it is a class. Why?
                    console.log 'View class: ' + @getBooksView()?.$isClass
Ext.application
    name: 'MyApp'
    controllers: [
        'Books'
    ]
    launch: ->
        Ext.Viewport.setActiveItem
            xtype: 'booksview'
Run Code Online (Sandbox Code Playgroud)

出现"Hello,Books"内容(例如,呈现组件),但甚至从不调用呈现控件处理程序.我在这做错了什么?

extjs sencha-touch extjs-mvc

0
推荐指数
1
解决办法
2481
查看次数

从按钮处理程序触发应用程序范围的事件

我有这个gridPanel:

Ext.define('BM.view.test.MacroList', {
extend: 'BM.view.GridPanel',
alias:'widget.macro-test-list',

store: 'Tests',

initComponent: function() {

    this.columns = [
        {
            xtype:'actioncolumn',
            width:50,
            items: [
            {
                icon: 'images/start.png',
                tooltip: 'Start Test',
                handler: function(grid, rowIndex, colIndex) {
                    this.application.fireEvent('testStart', grid.getStore().getAt(rowIndex)); 
                // application not defined here because 'this' is the button.
                }]
     }]
}
}
Run Code Online (Sandbox Code Playgroud)

stratTest是一个可以从应用程序中的许多地方获得的函数,我希望它可以用作应用程序范围的事件,但这些似乎只能从控制器中获得.
如何.application.fireEvent('testStart'...)从此按钮内的处理程序调用?

我正在使用这个问题作为事件的常量参考,以及Sencha文档,但找不到答案.

extjs extjs-mvc extjs4.1

0
推荐指数
1
解决办法
9742
查看次数

在ExtJS MVC会话期间存储用户信息的正确方法

我在哪里将用户特定(会话)信息存储在ExtJS MVC应用程序中?

定义一个自定义基本控制器是否正确,该控制器可以包含具有用户特定信息的对象并在应用程序中使用它?

例:

Ext.define("MyApp.controller.BaseController", {
    extend:  "Ext.app.Controller", 

    session:  Ext.create("MyApp.lib.UserSession"),

    init: function() {
      var me = this;

      me.session.init();

      /** some code **/
    },

    doSomething: function() {
      var me = this;

      var counter = me.session.get("counter"); 
    }

});
Run Code Online (Sandbox Code Playgroud)

javascript extjs extjs4 extjs-mvc

0
推荐指数
1
解决办法
7887
查看次数

动态更改图表系列extjs 4

我正在使用Extjs 4和MVC架构.

我有一个输出这个Json数据的python脚本:

{
"data": [
    {
        "inAnalysis": 3, 
        "inQuest": 2, 
        "inDevelopment": 6, 
        "total": 12, 
        "inValidation": 1, 
        "Month": 1303
    }, 
    {
        "inAnalysis": 1, 
        "total": 5, 
        "Month": 1304, 
        "inDevelopment": 4
    }
], 
"success": true, 
"metaData": {
    "fields": [
        {
            "name": "inAnalysis"
        }, 
        {
            "name": "inQuest"
        }, 
        {
            "name": "inDevelopment"
        }, 
        {
            "name": "inValidation"
        }, 
        {
            "name": "isDuplicate"
        }, 
        {
            "name": "New"
        }, 
        {
            "name": "total"
        }
    ], 
    "root": "data"
}
Run Code Online (Sandbox Code Playgroud)

}

我想将MetaData的字段用作图表系列,所以我有这样的商店:

Ext.define('Proj.store.ChartData', {
extend: 'Ext.data.Store',
autoload: true,
proxy: {
    type: …
Run Code Online (Sandbox Code Playgroud)

javascript charts json extjs extjs-mvc

0
推荐指数
1
解决办法
6441
查看次数

将ExtJS3迁移到ExtJS4

我是ExtJS的新手.由于客户端需要ExtJS3代码,我们需要将其转换为ExtJS4.我正在尝试很多,但它没有显示结果.

Html代码:

<html>
<head>
<title>Search Window With Ext JS 4</title>
<link rel="stylesheet" type="text/css" href="ext-4.0.1/resources/css/ext-all.css"/>
<script type="text/javascript" src="ext-4.0.1/ext-all.js"></script>
<script type="text/javascript" src="ext-4.0.1/bootstrap.js"></script>

<script type="text/javascript" src="searchwindow.js"></script>
<script type="text/javascript" src="SearchRegionPan.js"></script>

<body>
<div id="panel" style="padding:10px"></div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

ExtJS代码:searchwindow.js:

Ext.require(['*']);

 Ext.onReady(function(){

     Ext.QuickTips.init();

var SearchRegionPan = new SearchRegionPan();

//************************* SEARCH TAB **************************************
var searchTab = {
                    id          :   'searchTab',
                    border      :   false,
                    //autoHeight    :   true,
                    //title     :   searchTitle,
                    items       :   [SearchRegionPan,
                      {
                        xtype:'label',
                                    text:'',
                                    style:'padding:2px 1px 0 40px;font-weight: bold;color: red;text-align: center;',
                                    itemId  :   'totallabel'
                                    }],
                    title       : …
Run Code Online (Sandbox Code Playgroud)

extjs extjs4 extjs-mvc extjs3

-1
推荐指数
1
解决办法
2402
查看次数