标签: extjs4

如何在Extjs的卡片布局上获取当前活动项目的索引号(而非活动项目ID)?

如何在卡片布局上获取当前活动项目的索引号(而非活动项目的ID)?以下代码将返回活动项的ID:

     Ext.getCmp('my-wizard').getLayout().activeItem.id];
Run Code Online (Sandbox Code Playgroud)

如果我不想为我的组件项定义id而我只想访问活动项的索引号怎么办?

javascript extjs extjs4

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

如何在EXTJS 4网格中显示嵌套的Json数据?

我正在使用ExtJS 4.0,我想在网格中显示嵌套的JSON数据.为此,我使用Ext.data.reader.Reader文档"加载嵌套数据"中给出的示例.它既简单又简单但现在我想在网格中显示这些数据.我该怎么设置dataIndex

这是我的样本模型和商店:

Ext.define("data", {
    extend: 'Ext.data.Model',
    fields: ['year', 'state'],
    hasMany: {
        model: 'record',
        name: 'record'
    },
    proxy: {
        type: 'rest',
        url: 'Column.json.php',
        reader: {
            type: 'json',
            root: 'data'
        }
    }
});

Ext.define("record", {
    extend: 'Ext.data.Model',
    fields: ['id', 'autorization', 'expendture'],
    belongsTo: 'User'
});
var store1 = new Ext.data.Store({
    model: "data"
});
Run Code Online (Sandbox Code Playgroud)

而我的JSON:

{
    "data": [{
        "year": "2010",
        "state": "MP",
        "record": [{
            "id": "auth",
            "autorization": "9.201"
        }, {
            "id": "exp",
            "expendture": "1.250"
        }]
    }]
}
Run Code Online (Sandbox Code Playgroud)

我想阅读 …

grid json nested extjs extjs4

12
推荐指数
1
解决办法
2万
查看次数

学习ExtJS4

我想将ExtJS4用于我的下一个项目.但是,我是Ext的新手,也不是那些精通Javascript精细点的人.

有几本关于ExtJS3的好书.我应该首先从那些旧书中学习,然后将这些知识应用到v4中,或者API的变化是如此之大以至于没有必要先学习旧的书?

如果没有,那么学习Ext新手的最佳方法是什么?

extjs extjs4

12
推荐指数
2
解决办法
6155
查看次数

extjs网格 - 如何使列宽100%

属性width是像素宽度.

{
                xtype: 'grid',
                store: store,
                selModel: Ext.create('Ext.selection.CheckboxModel', {
                    mode: 'SINGLE'
                }),
                layout: 'fit',
                columns: [
                    {
                        text: "pum",
                        dataIndex: 'SRD_NAME_FL',
                        width: 400
                    }
                ],
                columnLines: true
            }
Run Code Online (Sandbox Code Playgroud)

如果我只有一列我如何使列宽= 100%或如果我有几列 - 如何使最后一列拉伸到网格结束?

grid extjs4

12
推荐指数
2
解决办法
4万
查看次数

ExtJS 4:执行继承的正确方法是什么

我的代码:

Ext.onReady(function() { // Every property is declared inside the class
Ext.define('MyCustomPanel1', {
    extend: 'Ext.panel.Panel',
    alias: 'mycustompanel1',
    title: 'I am a custom Panel 1',
    html: 'This is the content of my custom panel 1',
    renderTo: Ext.getBody()
});    


Ext.define('MyCustomPanel2', { // HTML is declared inside the class, title inside the config, constructor overridden
    extend: 'Ext.panel.Panel',
    alias: 'mycustompanel2',
    renderTo: Ext.getBody(),        
    html: 'This is the content of my custom panel 2',        
    config: {
        title: 'I am a custom Panel 2'
    },
    constructor: function(config) …
Run Code Online (Sandbox Code Playgroud)

inheritance extjs4

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

ExtJs4如何递归地禁用面板上的所有字段和所有按钮

我正在尝试禁用面板上所有可点击的可编辑组件.

调用panel.disable()灰色,但按钮仍然可以点击.相同的结果提供panel.cascade了禁用每个组件的功能.

这样做的正确方法是什么?

extjs extjs4

12
推荐指数
1
解决办法
2万
查看次数

让Django序列化没有"fields"字段的对象

所以我正在使用Django编写后端Web服务来创建和使用JSON,我的同事正在研究ExtJS4前端.我正在使用wadofstuff序列化程序,因此我可以序列化嵌套对象.

我的同事在解析json时遇到了麻烦,特别是Django将对象的字段放在"fields"字段中.一个简短的例子:

事情现在被序列化的方式:

{
  "pk":1,
  "model":"events.phone",
  "fields":{
     "person":1,
     "name":"Cell",
     "number":"444-555-6666"
  }
}
Run Code Online (Sandbox Code Playgroud)

我希望将它们序列化以使ExtJS和我的开发人员满意的方式:

{
  "pk":1,
  "model":"events.phone",
  "person":1,
  "name":"Cell",
  "number":"444-555-6666"
}
Run Code Online (Sandbox Code Playgroud)

我们需要序列化一些比这复杂得多的对象.

有没有办法手动编写我的序列化以使Django或wadofstuff序列化器不使用字段字段?

django json extjs4

12
推荐指数
3
解决办法
9594
查看次数

向Ajax请求添加标头

如何向ExtJS ajax请求添加请求标头?

我特意想添加标题:accept-encoding等于true.

extjs extjs4 extjs4.1

12
推荐指数
3
解决办法
2万
查看次数

使用up和down方法的extjs

我正在尝试使用updown调用而不是,Ext.getCmp但我不太了解它.我有这个代码

listeners: {
    'change': function(field, selectedValue) {
        // Ext.getCmp('wildAnimal').setValue(selectedValue);
        this.up('form').down('#wildAnimal').setValue(selectedValue);
    }
}
Run Code Online (Sandbox Code Playgroud)

在这个更大的代码里面

Ext.define('ryan', {
    constructor: function() {
        Ext.create('Ext.form.Panel', {
            bodyStyle: {"background-color":"green"},
            name: 'mypanel',
            title: 'Animal sanctuary, one animal per location  ',
            width: 300,
            bodyPadding: 10,
            test: 'mycat',
            style: 'background-color: #Fdd;',
            renderTo: Ext.getBody(),
            items: [{
                itemId: 'button1',
                xtype: 'button',
                text: 'click the button',
                handler: function() {
                    alert('(<^_^>)');
                }
            },{
                itemId: 'wildAnimal',
                xtype: 'textfield',
                fieldLabel: 'animal:',
                name: 'myanimal'
            },{
                itemId: 'myCombo',
                xtype: 'combo',
                fieldLabel: 'choose …
Run Code Online (Sandbox Code Playgroud)

extjs extjs4

12
推荐指数
2
解决办法
4万
查看次数

当我尝试使用jasmine进行测试时,在Ext.appliation中没有加载App文件夹

我正在尝试在我的应用程序(Ext js 5)中实现jasmine进行单元测试.为此我创建了app-test文件.

  Ext.require('Ext.app.Application');Ext.Loader.setConfig({enabled:true});
  Ext.onReady(function() {
      var  Application = Ext.create('Ext.app.Application', {
    name: 'epmct',
    appFolder:'app',
    launch: function() {
        Ext.create('epmct.view.vpp.dashboard.VppDashboardMainPage');
    }
    });
 });
Run Code Online (Sandbox Code Playgroud)

当我通过specrunner.html(文件开始单元测试)运行应用程序时,我收到错误

Uncaught Error: [Ext.Loader] Some requested files failed to load.
Run Code Online (Sandbox Code Playgroud)

我尝试使用Ext.Loader.setPath('epmct','app')设置路径; 仍然没有用.

请找到我的specrunner.html文件代码

    <!DOCTYPE html><html>
            <head>
          <meta charset="utf-8">
          <title>Jasmine Spec Runner v2.3.2</title>


          <link rel="shortcut icon" type="image/png" href="test/jasmine/jasmine_favicon.png">
          <link rel="stylesheet" type="text/css" href="test/jasmine/jasmine.css">
          <script type="text/javascript" src="test/jasmine/jasmine.js"></script>
          <script type="text/javascript" src="test/jasmine/jasmine-html.js"></script>
          <script type="text/javascript" src="test/jasmine/boot.js"></script>
          <!-- include Ext Js files and Css... -->
          <script src="ext/ext-all.js"></script>
          <!-- include spec files here... -->
            <script type="text/javascript" src="app-test.js"></script> …
Run Code Online (Sandbox Code Playgroud)

javascript extjs jasmine extjs4 extjs5

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

标签 统计

extjs4 ×10

extjs ×7

grid ×2

javascript ×2

json ×2

django ×1

extjs4.1 ×1

extjs5 ×1

inheritance ×1

jasmine ×1

nested ×1