Closed
Description
Hello,
I want to use Sortable on images with a FS collection. For now, drag and drop works only once and I have an error in the console: TypeError: templateInstance.collection.findOne is not a function ( rubaxa_sortable.js:1333:20)
How can I fix it?
I have a FS collection:
Images = new FS.Collection("images", {
stores: [
new FS.Store.FileSystem("images"),
new FS.Store.FileSystem("thumbs", { transformWrite: createThumb }),
],
filter: {
allow: {
contentTypes: ['image/*'] //allow only images in this FS.Collection
}
}
});
In sortable-collection.js (server side)
'use strict';
Sortable.collections = ['images'];
//I also tried Sortable.collections = ['cfs.images.filerecord'];
In the template portfolio.html:
{{#sortable items= imagesCursor sortField="metadata.order"}}
<img src="{{this.url store='thumbs'}}" alt="caption for {{this.name}}" target="{{this}}" />
{{/sortable}}
And in the portfolio.js helper imagesCursor function
var result = Images.find({ 'metadata.gallery':currentGallery}); // Images is an FS.Collection instance
return result;
Metadata
Metadata
Assignees
Labels
No labels