PDA

View Full Version : Draggable / Sortable list



martinbroos
24 Mar 2011, 1:58 AM
Hi,

I'm working on a list wich needs to be sortable. And eventualy it should sync with the model and online with a ajax call or something.

But in the first step i already get confused. How do i make a list sortable or draggable?

This is my code so far :


beheerpaneel.views.PagesIndex = Ext.extend(Ext.Panel, {
dockedItems: [{
xtype: 'toolbar',
title: 'Pagina Beheer',
dock: 'top',
ui: 'light',
defaults: {
iconMask: true,
ui: 'plain'
},
items: [
{
xtype: 'spacer'
},
{
xtype: 'button',
iconCls: 'add'
}]
}],
items: [{
fullscreen: true,
xtype: 'list',
store: beheerpaneel.stores.pages,
itemTpl: tpl,
onItemDisclosure: function (record) {
Ext.dispatch({
controller: beheerpaneel.controllers.Pages,
action: 'show',
id: record.getId()
});
}
}],
initComponent: function() {
beheerpaneel.stores.pages.load();
beheerpaneel.views.PagesIndex.superclass.initComponent.apply(this, arguments);
}
});

milton9480
12 Oct 2011, 5:46 AM
Please check that thread.
http://www.sencha.com/forum/showthread.php?102154-Drag-drop-sort-in-Touch&p=659116#post659116


Hi,

I'm working on a list wich needs to be sortable. And eventualy it should sync with the model and online with a ajax call or something.

But in the first step i already get confused. How do i make a list sortable or draggable?

This is my code so far :


beheerpaneel.views.PagesIndex = Ext.extend(Ext.Panel, {
dockedItems: [{
xtype: 'toolbar',
title: 'Pagina Beheer',
dock: 'top',
ui: 'light',
defaults: {
iconMask: true,
ui: 'plain'
},
items: [
{
xtype: 'spacer'
},
{
xtype: 'button',
iconCls: 'add'
}]
}],
items: [{
fullscreen: true,
xtype: 'list',
store: beheerpaneel.stores.pages,
itemTpl: tpl,
onItemDisclosure: function (record) {
Ext.dispatch({
controller: beheerpaneel.controllers.Pages,
action: 'show',
id: record.getId()
});
}
}],
initComponent: function() {
beheerpaneel.stores.pages.load();
beheerpaneel.views.PagesIndex.superclass.initComponent.apply(this, arguments);
}
});