webix-meteor-data icon indicating copy to clipboard operation
webix-meteor-data copied to clipboard

Saves are not persisted in the database

Open ghost opened this issue 10 years ago • 11 comments

this.source.collection and Meteor.connection._mongo_livedata_collections[this.source] is a reference to the LocalCollection. Using this collection will not send the updates to the server.

The user must provide the Meteor.Collection reference to the proxy to fix this.

ghost avatar Feb 25 '15 23:02 ghost

My saves aren't persisted at all. Showing (reading) a list of Translations is fine, but not saves. I know that the save is called, but nothing seems to happen whatsoever. Sanjo, do you have any advice about debugging these saves? Pressing enter in an editable field calls the save, but then nothing seems to happen. Any idea how to debug this or how to see what's happening? The save in the config of my webix datatable is like this: save: webix.proxy('meteor', Translations)

And Translations is instantiated in the normal way: Translations = new Mongo.Collection('translations');

mwarren2 avatar May 13 '15 20:05 mwarren2

To debug it, place a breakpoint in this line https://github.com/webix-hub/webix-meteor-data/blob/master/codebase/meteor-data.js#L94.

ghost avatar May 13 '15 21:05 ghost

Thanks for the pointer, which was a big help. The code is doing exactly what it should: the record _id is correct, the data is correct for the $set. However I see that the collection is a LocalCollection.

Could you explain the fix to me? What do you mean by the 'Meteor.Collection reference'? I only know the one way of referencing collections, and that gives the LocalCollection

mwarren2 avatar May 13 '15 22:05 mwarren2

The return value of new Mongo.Collection('translations'); is the right collection object. If that doesn't work maybe you don't declare the collection on the server side?!

ghost avatar May 14 '15 01:05 ghost

It's declared correctly in a .js file in the /lib folder, so it's available to both server and client. User permissions are all correct. At one stage I got rid of admin permissions, it still didn't work.

Thanks very much for your help, I'll just keep debugging!

mwarren2 avatar May 14 '15 07:05 mwarren2

Ok I think I have found my problem, something similar to yours, but I'll open another issue. At the moment I don't have a workaround, though I will look into it.

mwarren2 avatar May 20 '15 15:05 mwarren2

Sanjo, I need another favour, if you have time. Do you know a decent link that explains properly how to override packages using my project's /package folder? I'd like to take a look at my problem. I've read how wonderfully easy it is to override in this way.... I've tried copying webix_webix.js to the /packages folder, uninstalling webix:webix, reinstalling webix:webix, tried copying the whole folder to the packages folder, nothing works. How is this done? (a little detail would be helpful)

mwarren2 avatar May 21 '15 12:05 mwarren2

cd packages
git clone --recursive https://github.com/dandv/meteor-webix.git

And make sure that webix:webix is in your .meteor/packages file. Haven't tested it but should work ;-)

ghost avatar May 21 '15 13:05 ghost

Get it. Thanks. But, webix folder isn't there, and webix-meteor-data folder is empty. Maybe I'm not the right kind of user?

mwarren2 avatar May 21 '15 13:05 mwarren2

It uses submodules with ssh URLs. So you just need to have your SSH key setup correctly with Github and then do:

cd packages/meteor-webix
git submodule init
git submodule update

You can learn more about submodules here: https://git-scm.com/book/en/v2/Git-Tools-Submodules#Cloning-a-Project-with-Submodules

The --recursive option does the same and it worked for me.

ghost avatar May 21 '15 16:05 ghost

Thanks, done all that and I've got the stuff, thanks for the help with the noob questions

mwarren2 avatar May 21 '15 18:05 mwarren2