Home › Forums › Classic DFFS › How add SPServices as a plugin?
Tagged: Installation, plugins, SPServices
- This topic has 3 replies, 2 voices, and was last updated 7 years, 9 months ago by Alexander Bautz.
-
AuthorPosts
-
-
February 25, 2017 at 01:24 #15869
It seems to me that the installation manual used to give instructions on how to add additional plugins such as SPServices to DFFS. However, I am unable to find those instrutions now. (Forgive me if I simply haven’t searched in the right place.) I need to use the SPServices library for a project, so I am currently adding the reference to it in a CEWP on my Default New Form, but I would rather modify my DFFS install so that the SPServices library is available on all my forms that use DFFS.
Is there a way to add it as a plugin, or must I manually add the reference to one of the DFFS files?
-
February 25, 2017 at 20:54 #15877
Hi,
You should be able to load the js file in the top of the Custom JS tab in each form you want to load it in.What exactly are you using SPServices for? – There might be functionality in spjs-utility or DFFS that can do the same for your without the need to load an additional file.
Best regards,
Alexander -
February 26, 2017 at 01:26 #15889
I’m using SPServices GetListItems function to get text contained in another list on my site to display on the form.
If there is functionality in DFFS to do that already, I would love to use that.
As far as including SPServices, all I need to do is include a script reference in the Custom JS config page, like this?
-
February 26, 2017 at 17:17 #15893
Here is a simple example of how you can query another list:
var res = spjs.utility.queryItems( { "listName":"The display name or the GUID of the child list", "query":"<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>YOUR SEARCH STRING</Value></Eq></Where>", "viewFields":["ID","Title"] } ); $.each(res.items,function(i,item){ console.log(item.Title); });
Add new fields to the “viewFields” array.
You find more examples by searching from “queryItems” in the forum.
Regarding the referring a js file in the Custom JS tab:
Please note that you must have a relatively new DFFS version (don’t remember the exact version) and you will find a separate textarea above the Custom JS where you have a help icon describing the setup.If you have an older version of DFFS you can use the jQuery getScript method to load the external js in the Custom JS.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.