Sencha touch 2 对Sencha中列表中的特定项执行某些操作

Sencha touch 2 对Sencha中列表中的特定项执行某些操作,sencha-touch-2,Sencha Touch 2,我面临的问题是,当我单击“删除”按钮时,无法从列表中删除任何行或多行。以下是我的代码: { xtype: 'list', store: "Plays", itemId:"playsList", mode: 'MULTI', loadingText: "Loading PlaysList...", emptyText: '<div class="notes-list-empty-text"

我面临的问题是,当我单击“删除”按钮时,无法从列表中删除任何行或多行。以下是我的代码:

    {
        xtype: 'list',
        store: "Plays",
        itemId:"playsList",
        mode: 'MULTI',
        loadingText: "Loading PlaysList...",
        emptyText: '<div class="notes-list-empty-text">No PlayList found.</div>',
        itemTpl: '<div class="list"><div class="list-item-title">{title}</div><div class="list-item-narrative">{duration}</div><div class="list-item-hide">{hidden}</div></div>',      
        itemSelector: 'div.list',

   },
    {
                    xtype: "button",
                    iconCls: "trash",
                    iconMask: true,
                    itemId: "deleteButton"
            },

   onDeleteButtonTap: function () {
        //console.log("deleteNoteCommand");//How to get value of recored from playlist

    this.fireEvent("deleteNoteCommand", this);
},

当您在选择列表记录后点击按钮时,您可以使用下面的代码获得所选的列表记录

  var record= this.getNotesList().getSelection()[0];
this.getNotesList().getStore().remove(record);//bracket in here too....
此代码为您提供所选记录,然后您可以使用以下代码从存储中删除该记录

  var record= this.getNotesList().getSelection()[0];
this.getNotesList().getStore().remove(record);//bracket in here too....

我在控制台记录未捕获的TypeError时出错:对象函数(){args.push.apply(args,arguments);返回fn.apply(scope | | this,args);}没有方法“getSelection”抱歉添加()brecket在this.getNotesListI的末尾,我也没有看到括号…很抱歉:)还有一个问题,如何删除多行意味着我想添加数组。getSelection()提供了数组,所以你可以循环抛出这个数组,并作为参数逐个传递到remove()方法,就是这样。