Sorting feature

Permalink Browser Info Environment
I've always wanted to add sorting functionality to this add-on, today i checked the code and saw it has already, but it's not working.
I think the reason is file list wrapper selector that does not exist.
at the file \tony_multi_file_attribute\models\attribute\types\multiple_files\form.php line 16 i changed:
$('.multiFileAttribute_attachedFilesList').sortable({

to
$('#ak<?php echo $this->attributeKey->getAttributeKeyID() ?>_attachedFilesList').sortable({

and it seems works fine when i try to sort files at page properties modal.
But i used this add-on at the composer and there it's not working.
any ideas?

Type: Discussion
Status: In Progress
shahroq
View Replies:
Jozzeh replied on at Permalink Reply
Jozzeh
When you look in the console of firebug or chrome, then you'll notice an error : $().sortable is not a function ;

This is cause by jquery ui not properly being loaded or not loaded at all on a composer page. i have solved it by adding the sortable function of jquery ui to the form function in the controller.php and set a new class on the sortable function in the form.php . The output of form.php is also changed a bit to give back a unsorted list.

I will reply with all the code attached once i've fully tested it.
Jozzeh replied on at Permalink Reply 1 Attachment
Jozzeh
As promised, attached is the 'multiple files' map of the multi-file module.

I've tested it a bit, but I do not garantee anything. Test it thoroughly if you are going to use it in a production environment.
aaronmarp replied on at Permalink Reply
aaronmarp
This fix worked perfect!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.