I've just installed Sencha Touch 2.3, and I notice there is a new plugin called "Ext.plugin.SortableList":
http://docs.sencha.com/touch/2.3.0/#!/api/Ext.plugin.SortableList
I was in the middle of writing my own sortable list, based on Sencha Touch 2.2.1, when I saw this and thought it was time to upgrade Sencha Touch and use a plugin instead.
Can anyone provide a small example of how to use this? I was hoping it would allow me to specify a handle selector for dragging and use it straight away, but it doesn't seem to work. Code is below. Any help appreciated.
Ext.define('kcm.view.favslist', {
extend: 'Ext.List',
requires: [
'Ext.dataview.List',
'kcm.store.favstore',
'Ext.plugin.SortableList'
],
xtype: 'favslist',
config: {
height: '100%',
width: '100%',
emptyText: 'No favorites. Tap the Add button to add the current topic.',
store: 'favstore_id',
itemTpl: '<table id="each_fav" width="100%" valign="center" border="0"> '+
'<tr valign="center">'+
'<td valign="center" width="30"><div>' +
'<input type="image" name="Delete" id="delfav" src="resources/images/deletebuttonnew.png" ' +
'</div></td>'+
'<td><div class="fav_title">{fav_name}</div>' +
'<div class="fav_breadcrumb">{breadcrumb}</div></td><td valign="center" width="30"><div>' +
'<input type="image" name="dragfav" id="dragfav" zindex="99999" src="resources/images/dragitem.png" ' +
'</div>'+
'</td>'+
'</tr>'+
'</table>',
plugins: [
{
xclass: 'Ext.plugin.SortableList',
handleSelector: 'dragfav'
}
]
}
});
Thanks,
Andy.