首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法在ItemSelector EXTJS3中显示选定项目

无法在ItemSelector EXTJS3中显示选定项目
EN

Stack Overflow用户
提问于 2012-03-01 12:40:17
回答 2查看 964关注 0票数 1

我正在使用视图中的extjs开发ASP项目。我在EXTJS中使用ItemSelector有问题。

这是我的代码:

代码语言:javascript
运行
复制
var isForm = new Ext.Panel({
    fieldLabel: 'Role',
    width: 700,
    bodyStyle: 'padding:10px;',
    store: GroupStore,
    //renderTo: 'itemselector',
    items: [        
    {
        xtype: 'itemselector',
        name: 'itemselector',
        fieldLabel: 'ItemSelector',
        imagePath: '../../ExtResources/ux/images/',
        multiselects: [{
            legend: 'Available',
            width: 250,
            height: 200,
            store: GroupStore,
            displayField: 'groupName',
            valueField: 'groupID'
        }
        , {
            legend: 'Selected',
            width: 250,
            height: 200,
            store: [['','']]
        }]
    }]
});

这是我的店铺:

代码语言:javascript
运行
复制
var GroupStore = new Ext.data.JsonStore({
    remoteSort: true,
    root: 'data',
    //autoLoad: loadStore2,
    autoLoad: true,
    totalProperty: 'totalCount',
    idProperty: 'groupID',
    fields: [{
        name: 'groupID'
    }, {
        name: 'groupName'
    }],
    proxy: new Ext.data.HttpProxy({
        //url: 'InputUserLoadHandler.ashx?get=groups&comp=HSO'
        url: 'InputUserLoadHandler.ashx?get=groups'
    })
});

在“选定”栏不能显示已经选定的项目。我曾经尝试过在“可用”栏和“已选”栏中使用我的商店,但结果是商品已经显示在两面。

this是我的ItemSelector,请给我解决这个问题的办法…

EN

回答 2

Stack Overflow用户

发布于 2012-03-01 15:59:13

您可以设置窗体的store属性。这是不正确的。尝试在项目选择器中设置store。

票数 0
EN

Stack Overflow用户

发布于 2012-03-07 15:59:14

我正在从数据库重新加载数据,我的项目使用Json来缓冲数据。companyStore的数据格式如下:

代码语言:javascript
运行
复制
{ "totalCount":"4", "data":[
  {
    "groupID": 1,
    "groupName": "Receiving"
  },
  {
    "groupID": 2,
    "groupName": "Checking"
  },
  {
    "groupID": 3,
    "groupName": "Shipment & Packing"
  },
  {
    "groupID": 4,
    "groupName": "Display Stock"
  }
] }

可以使用ItemSelector吗?在使用数组的sencha示例中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9510697

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档