Linked QSortable
Sat, 04/23/2011 - 22:14
I have a need to connect two QSortables and allow drag and drop between the two like in this example Sortable connect lists. I am able to create both list and each list can be sorted within itself, however when I try to move an item from list A to List B the item fails to move. I am using the ConnectWith property to join the two list to each other. Does anyone have an example of this functionality working with QSortable?

As is usually the case, after posting this question I found the answer. The issue was when setting the class selector of the ConnectWith property, I was just using the name "$this->Sortable2->ConnectWith = 'sortable';". I should have used the CssClass with the "." like "$this->Sortable2->ConnectWith = '.sortable';". Works like a charm now.
Code snippet for anyone who may later search this issue.
// Sortable
$this->Sortable = new QSortable($this);
$this->Sortable->AutoRenderChildren = true;
$this->Sortable->CssClass = 'sortable';
for ($i = 1; $i <= 5; ++$i) {
$pnl = new QPanel($this->Sortable);
$pnl->Text = 'Item '.$i;
$pnl->CssClass = 'sortitem';
}
$this->Sortable->Items = 'div.sortitem';
$this->Sortable2 = new QSortable($this);
$this->Sortable2->AutoRenderChildren = true;
$this->Sortable2->CssClass = 'sortable';
for ($i = 1; $i <= 5; ++$i) {
$pnl = new QPanel($this->Sortable2);
$pnl->Text = 'Item '.$i;
$pnl->CssClass = 'sortitem';
}
$this->Sortable2->Items = 'div.sortitem';
$this->Sortable->ConnectWith = '.sortable';
$this->Sortable2->ConnectWith = '.sortable';
You can tiffany naszyjniki report tiffany zestawów the theft tiffany klucze toward police, but there won't be something they tiffany bizuteria are able to do about it. The only provide about for filing a law enforcement report is so tiffany kolczyki they are able to see if there's a pattern founded with that particular diamond jewelry store.