您的位置:首页 > 其它

sencha touch SortableList 的使用

2014-05-23 14:49 197 查看
转: sencha touch 2.3 多了一个 SortableList plugin, 可实现 list item 的拖动交换

Ext.require('Ext.plugin.SortableList');
Ext.create('Ext.List', {
fullscreen: true,
// Set the class to the name you passed in for the handleSelector
itemTpl: '<div class="gripper">{title}</div>',
data: [
{ title: 'Item 1' },
{ title: 'Item 2' },
{ title: 'Item 3' },
{ title: 'Item 4' }
],

// These are required to fix a bug that exists in the plugin
infinite: true,
variableHeights: true,

plugins: [
{ xclass: 'Ext.plugin.SortableList', handleSelector: '.gripper' }
],

listeners: [
{
event: 'dragsort',
fn: function (listObject, row, to, from) {
console.log(from + ' ' + to);
}}
]
});


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: