salvattore icon indicating copy to clipboard operation
salvattore copied to clipboard

How to use API methods with jQuery?

Open micperr opened this issue 11 years ago • 2 comments

Hi, first of all thank you very much for the great job you've done.

I got salvattore working without any issues with just CSS. But I have no idea how to access salvattore instance in order to use your API methods (I am not using RequireJS or similar so your gist example didn't help me too much).

At the beginning I was sure you register the plugin instance under salvattore global variable (root.salvattore = ...) but it stays undefined always so I cannot do salvattore['append_elements'](grid, [item]).

I had a look inside the code but since I am mainly backend developer this JS seemed just too weird for me to find a solution ;)

You wrote "However, you can still use jQuery or any other JS library to work with the API to get advanced functionality." I think it would be good idea to extend docs with a short sample code how to do it.

BTW I also noticed errors like "Uncaught TypeError: Cannot read property 'length' of undefined" (it is about rules variable) or "a is undefined". I'd create dedicated issue for this if you confirm it is not known and currently expected behaviour because despite the errors grid is contructed fine.

micperr avatar Feb 25 '14 23:02 micperr

Did you ever find a solution for this? I'm wondering the same thing.

andrewlphilpott avatar Jul 15 '14 19:07 andrewlphilpott

Unfortunately not. I switched to masonry eventually.

micperr avatar Jul 23 '14 10:07 micperr