【问题标题】:Sencha touch list group煎茶触摸列表组
【发布时间】:2011-12-25 11:35:27
【问题描述】:

我有一个清单:

{
    xtype: 'list',
    itemTpl: '{name}',
    sorters: 'name',
    getGroupString: function(record) 
        { 
            return record.get('name')
         },
    indexBar:true,
    grouped: true,
    store: {
        fields: ['name', 'url'],
           data: centres
    },
    itemConfig: {
      tpl: '{url}'
    },
    listeners: {
      itemtap:function(data,index){
        var record = data.getStore().getAt(index);
        redirect_url = record.raw.url
         // the record that has been clicked.
         window.location = redirect_url
      }
    }
  }

我想按名称对列表进行分组。但是结果没有被分组。

【问题讨论】:

    标签: extjs sencha-touch-2


    【解决方案1】:

    排序器(接受一个字符串数组),getGroupString 是存储的一部分。这家商店还需要一个模型来支持它。

    我不确定你想用 itemTpl 和 itemConfig 做什么来显示两个不同的东西,如果你想在列表中显示 name 属性,那么你只需要 itemTpl。

    参见 KitchenSink 列表示例: http://docs.sencha.com/touch/2-0/#!/example/kitchensink/index.html

    用户界面 --> 列出并点击右上角的 Source 按钮。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多