-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: templateInstance.collection.findOne is not a function. -- With Meteor, fairly basic implementation using <divs> with form elements inside #768
Comments
Looks to be that Sortable for Meteor doesn't support Array's yet. 😔 |
Ah -- yes. The helper that was feeding in "products" was: Template.productSettings.helpers({ I've changed that to: Template.productSettings.helpers({ ... and now this particular error isn't happening. Now it just says "Access Denied" when the update tries to occur. Progress?!? |
In case this helps anyone else... it looks like this plugin doesn't quite work out-of-the-box with Meteor when you are not in insecure mode. To fix, you need to manually allow update access to the collection like this (in my case the collection is Products): Products.allow({ |
Dear all! Meteor is moved to the separate repository. If this issue is still actual, please create it there once again. For your info: this project needs a maintainer. |
Good to know! The page on Atmosphere.js still points to the non-Meteor GitHub page... is there any way to get that updated? https://atmospherejs.com/rubaxa/sortable >> https://github.com/RubaXa/Sortable/ |
Thanks screaser, you are a life saver! |
had this problem too, the atmosphere link still points here please correct it! |
Using Meteor I implemented a pretty basic rubaxa:sortable instance. Not using multiple sortable lists or anything fancy. Pre-loaded "order" data in my Mongo Collection with unique numbers 1, 2, 3, etc.
Everything displays fine, and lets you sort once then the package dies when it tries to save the new order to the DB.
Error in the browser console is:
TypeError: templateInstance.collection.findOne is not a function. (In 'templateInstance.collection.findOne(itemId)', 'templateInstance.collection.findOne' is undefined) adjustOrdersrubaxa_sortable.js:1404 sortableUpdaterubaxa_sortable.js:1446 _dispatchEventrubaxa_sortable.js:1102 _onDroprubaxa_sortable.js:799 (anonymous function) handleEventrubaxa_sortable.js:853
Relevant code snippets below...
Server:
Products = new Mongo.Collection('products'); Sortable.collections = ['products'];
Client:
<div class="sortable target" id="object"> {{#sortable items=products animation="100" handle=".sortable-handle" ghostClass="sortable-ghost" sortField="order"}} {{> productSettingsRow}} {{/sortable}} </div>
`
Tried searching the Issues; don't see anything quite like this though #578 seems similar(?). Also didn't see a way to recreate in the JS scratchpad as requested since it has to do with DB access...
Any suggestions, or any other info I can provide to help debug?
The text was updated successfully, but these errors were encountered: