Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
John Croft
Sortable
June 1, 2011 2:52 PM
Answer

John Croft

Rank: New Member

Posts: 10

Join Date: February 15, 2010

Recent Posts

I have a sortable list with an event that I want to fire on drag:end. This seems to work ok if the user is NOT logged into liferay or if they are logged in and I have set js_fast_load=0.

Something with the minifier seems to be interfering with my event as it never fires but the drag and drop behavior still works.

This is in liferay 6.06.

sample code:
<div class="my-list">
<table>
<tbody>
<tr>
<td>1</td>
<td>A</td>
</tr>

<tr>
<td>2</td>
<td>B</td>
</tr>

<tr>
<td>3</td>
<td>C</td>
</tr>

<tr>
<td>4</td>
<td>D</td>
</tr>


</tbody>
</table>

</div>


<script type="text/javascript">
AUI().ready('aui-sortable', function(A) {
function dragEnd(e) {
console.log('drag end');
}

function sortInit(e) {
console.log('sort init');
}

var mySortable = new A.Sortable(
{
nodes: '.my-list table tbody tr',
after: {'drag:end': dragEnd, 'sortable:init': sortInit}
});

});
</script>
John Croft
RE: Sortable
June 10, 2011 10:00 AM
Answer

John Croft

Rank: New Member

Posts: 10

Join Date: February 15, 2010

Recent Posts

Bumping my own post. Can anyone at least validate from my sample code that events are not firing when the javascript minifier is on? Is this a bug in alloy ui?
Terry Jeske
RE: Sortable
February 24, 2012 8:45 PM
Answer

Terry Jeske

Rank: Junior Member

Posts: 42

Join Date: June 23, 2010

Recent Posts

I have the same problem. Very frustrating. Has any one gotten the drag:end event to work while being an admin? Does anyone have a solution for sorting lists in a portlet using javascript? I tried to use jquery.ui but lifery pukes a an error whenever I include it in at portlet.