我想添加和清空项目(显示值为空,项目高度保持正常)到Ext.form.ComboBox.我在下面提到了2个链接来配置我的组合框,但它仍然没有显示空项目:
这是我的代码:
this.abcCombo = new Ext.form.ComboBox({
    name : 'abcCombo',
    hiddenName : 'abcCombo-id',
    fieldLabel : "My Combobox",
    width : 250,
    editable : false,
    forceSelection : true,
    mode : 'local',
    triggerAction : 'all',
    valueField : 'id',
    displayField : 'fullName',
    store : new Ext.data.JsonStore({
        fields : ['id', 'fullName']
    }),
    tpl : '<tpl for="."><div class="x-combo-list-item">{fullName} </div></tpl>'
});
组合框存储的数据将在Ajax请求(即数据项中的3个项)之后加载.组合框只有3项(不是我预期的4项).你对我的问题有任何想法吗?!非常感谢!
在Angular JS中是否有相当于Backbone的Collection或Ext JS的商店?我正在学习$ resource,但并没有完全掌握这方面的内容.
// This is the "collection" I'm interested in.
$scope.foos = [];
// Foo is a $resource.
Foo.query(function (foos) {
  // This works, but is there a smarter "collection" object?
  $scope.foos = foos;
});
$scope.createFoo = function (data) {
  var foo = new Foo(data);
  foo.$save(function (shinyNewFoo) {
    $scope.foos.unshift(shinyNewFoo);
  });
};
在$scope.createFoo我制作一个新的Foo,坚持它,然后将它添加到我的穷人的集合,一个阵列.这工作正常,视图正确更新,但我太懒了.理想情况下,我想要一个我可以添加和删除的"集合"将自动POST/DELETE.也许类似以下内容.
$scope.fooCollection = new CoolCollection({
  // specify the type of resources this collection will …javascript angularjs backbone.js-collections extjs-stores angular-resource
我有一个链接到商店的网格autoLoad: true.问题是商店在应用程序启动时加载,即使稍后在通过菜单访问时创建视图也是如此.
我在Application.js和视图中引用了商店,但我没有明确地对商店和视图进行实例化.
我不知道如何实现只在视图需要时才加载存储.
autoLoad: true,商店将在应用程序启动时加载.autoLoad: false,商店根本没有加载.我知道这是非常基本的,但我到目前为止都陷入困境.
以下是所有相关的参考代码:
app/store/Owners.js
Ext.define('Mb.store.Owners', {
    extend: 'Ext.data.Store',
    model: 'Mb.model.Owner',
    autoLoad: true,
    proxy: {
        ...
});
的application.js
Ext.define('Mb.Application', {
    name: 'Mb',
    extend: 'Ext.app.Application',
    models: [
        'Owner'
    ],
    stores: [
        'Owners'
    ],
    ...
应用程序/视图/ Owners.js
Ext.define('Mb.view.winbiz.Owners', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.test-gridPanel',
    store: 'winbiz.Owners',
    columns: [{
    ...
视图在控制器中实例化:
Ext.define('Mb.controller.Winbiz', {
    extend: 'Ext.app.Controller',
    views: [
        'Owners'
    ],
    init: function(){
        this.control({
            'menu #test': {click: this.onMenuTest},
        })
    },
    onMenuTest: function(){
        this.getController('Main').addToMainTab('test-gridPanel');
    },
我正在使用ExtJS 4.1.我正在使用商店clearFilter()从商店中删除过滤器.我正在使用filterBy方法将过滤器应用于商店.我正在过滤所有名字不是罗纳尔多的记录.
清除过滤器后,我加载一个包含网格的视图(附加到商店).但是当我加载网格时,我仍然可以看到过滤器未被清除.这家商店是当地商店.我没有在商店上应用任何分组.商店只使用一种型号.
myStore.filterBy(function (record) {
    if (record.get('Name') != 'Ronaldo') {
        return true;
    }
});
虽然这一切都很好,但是当我通过使用清除过滤器时clearFilter(),需要一些时间.使用过滤器时,是否有更快\更好\正确的方法来清除商店中的过滤器filterBy()?
我正在使用ExtJs 4.1框架.我有一个网格,只显示一列(名称).网格与具有两个字段(Name和SortOrder)的商店相关联.商店中的"名称"字段与网格的"名称"列相关联.我想根据商店中SortOrder字段中可用的值对名称列进行排序.我怎样才能实现这样的逻辑.
谢谢
我有一个网格列表,可以由最终用户在表单中更改其数据.最后,我想通过单击按钮同步所有网格,然后执行操作.
我写了下面的代码:
$.when.apply(
    Ext.ComponentQuery.query('grid')
       .forEach(function(item) {
             if (item.getXType() == "grid") {
                if (item.store.getNewRecords().length > 0 || item.store.getUpdatedRecords().length > 0 || item.store.getRemovedRecords().length > 0) {
                    item.store.sync();
                 }
             }
})).then(function (results) {
    //do something
});
问题在于store.sync()不等待回调.
这样做的推荐方法是什么?
this.loadSmt = function(argPanel) 
{
    this.store1 = new Ext.data.JsonStore({
        url             : 'URL1',
        totalProperty   : 'total',
        successProperty : 'success',
        root            : 'root1',
        fields          : [
                            {name: 'data1'},
                            {name: 'data2'}
                        ]
    });
    this.store2 = new Ext.data.JsonStore({
        url             : 'URL2',
        totalProperty   : 'total',
        successProperty : 'success',
        root            : 'root2',
        fields          : [
                            {name: 'data21'},
                            {name: 'data22'},
                            {name: 'data23'},
                            {name: 'data24'},
                            {name: 'data25'}
                        ]
    });
    this.store1.on('beforeload', function() {
        this.store1.baseParams = {
            argID: myID
        };
    }, this);
    this.store2.load({
        callback    : function() {
            var graphOwner = argPanel; …我正在使用Ext.data.Store的each().但是,当过滤存储时,此方法仅循环遍历过滤的记录.即使在商店中应用过滤器,我们是否有任何其他方法或解决方法来遍历商店的所有记录.
  var attStore = Ext.getStore("myStore");
        var allRecords = attStore.snapshot || attStore.data;
        allRecords.each(function (record) {
            if (record.data.IsUpdated) {
                record.set('updatedByUser', true);
            }
            else {
                record.set('updatedByUser', false);
            }
             record.commit();
        });
该行   var allRecords = attStore.snapshot || attStore.data;实际上按预期返回所有记录,但是当我尝试使用record.data.property = something更新该记录(或该记录中的一个属性)时,该记录没有得到更新.
谢谢
我正在研究extjs 4 MVC应用程序.
应用程序运行Viewport,其中包含tabpanel.每个选项卡都有自己的控制器和多个视图
请访问http://wap7.ru/folio/ext-reuseable-store/TE.html查看我的沙盒
我有一个商店多次使用(例如topmenu组合框中的一个选项卡,clietns网格中的另一个选项卡.)配置了autoload的商店:true.代理在模型中配置.
我的问题:Store多次加载 - 在控制器[stores]数组中提到.
如果我从数组中删除一个[stores] controller- combobox将为空,尽管它表示store:Ext.getStore('STORE-ID')
请给我一个提示,或者重新使用商店(不是模型)的例子,如http://docs.sencha.com/ext-js/4-0/#!/guide/mvc_pt2
我对商店负载有问题.Extjs在30秒后取消加载.是否有一些参数或其他东西来增加存储加载时间?
这是商店的例子:
  var store = Ext.create('Ext.data.Store', {
        model : 'store_model',
        proxy : {
            type : 'ajax',
            url : 'data/backend.php',              
            reader: {
                type: 'json',
                root: 'data'
            },
            writer: {
                type: 'json'
            }
        },          
        autoLoad : true
    });
extjs-stores ×10
extjs ×8
extjs4 ×4
extjs4.1 ×3
javascript ×3
angularjs ×1
combobox ×1
extjs-grid ×1
extjs-mvc ×1
extjs3 ×1
extjs4.2 ×1
gridpanel ×1
promise ×1
reusability ×1
scope ×1
store ×1