OlivierCC / spfx-40-fantastics

This package is a sample kit of Client Side Web Parts built on the SharePoint Framework SPFx. You can find here different kind of high visual web parts as carousel, images galleries, animations, map, editors, etc.
MIT License
411 stars 277 forks source link

Multiple Instances #13

Closed natelabo closed 7 years ago

natelabo commented 7 years ago

I am trying to add different web parts to the same page. When I add these only a single instance of the web part appears to work. Is there a way to make a news tiles and news carousel work on the same page?

OlivierCC commented 7 years ago

Hi @natelabo, do you use the released package available in the releases page (https://github.com/OlivierCC/spfx-40-fantastics/releases) or your own copy ? I had a similar issue in the past, but normally the 1.0.2 version distributed in this page has a durty fix for that (fix with a custom version of jQuery for the moment).

natelabo commented 7 years ago

I setup a new dev environment. I'm sure I'm probably pulling from the jQuery repository. I'll attempt to revert to the version that is included with this package.

OlivierCC commented 7 years ago

The problem with the new tiles & news carousel come from unitegallery and the SharePoint Framework : 1: unitegallery is better with jquery version < 3.X 2: with the SharePoint Framework, each version try to load jQuery. jQuery is loaded only 1 time of course, but the fact to call it again will erase the previous jQuery plugins. So in the 40 Fantastic CDN, the jQuery version contains a fix to be sure that if jQuery is already loaded, the jQuery plugins will not be erased.

I will try to find a better fix in the future.

Regards,

Olivier

natelabo commented 7 years ago

Thank you for your response... I'm pretty new to this can you point me to where I can find your jQuery version and how do I reference it. I'm looking through the commits for 1.0.2 but I'm not seeing where it was changed.

Also I've created another issue regarding using the new sp-client-custom-fields.

OlivierCC commented 7 years ago

sure, the jQuery version with the fix is available from the CDN here: http://spfx40fantastics.azureedge.net/spfx40fantastics/jquery_510295b52d8a7cc774bf4fb013893d1e.js

natelabo commented 7 years ago

Worked like a charm. Thanks!