Page 1 of 1

how to use spservices framework with fd ?

Posted: 17 Mar 2013
by Bruno BICEP
My goal is to use with fd spservices framework, specially $().SPServices.SPCascadeDropdowns function.

It doesn't work?


Someone can help me ?

Re: how to use spservices framework with fd ?

Posted: 18 Mar 2013
by Dmitry Kozlov
Include jquery and spservices library into your master page:

<script language="javascript" type="text/javascript" src="/Style%20Library/SPServices/jquery-1.8.3.min.js"></script>

<script language="javascript" type="text/javascript" src="/Style%20Library/SPServices/jquery.SPServices-0.7.2.min.js"></script>


In Forms Designer's javascript editor use window.$ instead of just $ to use SPServices. Example:

window.$().SPServices.SPCascadeDropdowns({

relationshipList: "Regions",

relationshipListParentColumn: "Country",

relationshipListChildColumn: "Title",

CAMLQuery: "",

parentColumn: "Country",

childColumn: "Region",

debug: true

});


$ is an internal Forms Designer jQuery-library that is included in compatibility mode to prevent conflicts with existing jquery-libraries.

So, you have to include your own jquery library in master-page and use window.$ or jQuery variables.

Re: how to use spservices framework with fd ?

Posted: 24 May 2013
by bburke
Added references to jquery and SPServices to the master page. Verified the reference is good..)

Added this to the javascript editor in the new form:


window.$().SPServices.SPLookupAddNew({
lookupColumn: "ClassificationLevel",
promptText: "Add new {0} "
});


This is what fd produced in fd_Item_New.aspx

<script language="javascript" type="text/javascript">//<![CDATA[
var fd_tabcontrol_ids = [];
$fd_jQuery(document).ready(function() {
var $ = $fd_jQuery;
fdInitForm($);
window.$().SPServices.SPLookupAddNew({
lookupColumn: "ClassificationLevel",
promptText: "Add new {0} "
});

});
//]]></script>

Unfortunately it's still not working.... any ideas? Thanks, Bill

Re: how to use spservices framework with fd ?

Posted: 24 May 2013
by Dmitry Kozlov
Workaround is absolutely the same as for SP2013: viewtopic.php?f=1&t=151#p624

Re: how to use spservices framework with fd ?

Posted: 01 Oct 2013
by MES5464
Do we still have to add the to the master page? We we still have to uses version 1.9.0?

<script language="javascript" type="text/javascript" src="/Style%20Library/SPServices/jquery-1.8.3.min.js"></script>

<script language="javascript" type="text/javascript" src="/Style%20Library/SPServices/jquery.SPServices-0.7.2.min.js"></script>

Re: how to use spservices framework with fd ?

Posted: 02 Oct 2013
by Dmitry Kozlov
Forms Designer includes JQuery in compatibility mode, so, you can include any version of JQuery and SPServices you need.

Re: how to use spservices framework with fd ?

Posted: 13 Feb 2014
by schuess
Instead of adding this script tag into the master page, can we use a custom action to deploy a script link?


for example?


<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

<CustomAction Location="ScriptLink"

ScriptSrc="~Site/lists/CRR Solution Assets/autoNumeric.js"

Sequence="100"

Id="autoNumeric"

xmlns="http://schemas.microsoft.com/sharepoint/" />

</Elements>

Re: how to use spservices framework with fd ?

Posted: 14 Feb 2014
by Dmitry Kozlov
Hello,

Sure, you can, but it will be loaded to all pages, not only forms. Also, if this script uses $ or jQuery variables, you have to include your own JQuery library, because as I mentioned above, Forms Designed includes JQuery in compatibility mode, so, these variables are not available globally.

Re: how to use spservices framework with fd ?

Posted: 12 Apr 2016
by lijupnandanan
Hi,

i tried to get data from a lsi using SPService caml Query. But I got an error like "SPServices error Object doesn't support property or method SPFilterNode" . I referred spservice and jquery min js on master page. Still got this error.

This is my Code


function GetQueryDetAndHide(columnName)
{
alert("Qry Hide");
var thisSite = window.$().SPServices.SPGetCurrentSite().toLowerCase();
alert("Site :"+thisSite);
//thisSite=thisSite.replace("qhse","admin");
var serviceURL = thisSite;
try
{
window.$().SPServices({
operation: "GetListItems",
async: false,
webURL: serviceURL ,
listName: "SettingsList",
CAMLQuery: "<Query><Where><Eq><FieldRef Name='Value' /><Value Type='Lookup'>"+columnName+"</Value></Eq></Where></Query>",
CAMLViewFields: "<ViewFields> <FieldRef Name='Title' /> </ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
alert('qry inside remove');
var liHtml = $(this).attr("ows_Title") ;
alert(liHtml);
$("nobr:contains("+liHtml+")").parent('h3').parent('td').parent('tr').hide();
$("#tasksUL").append(liHtml);

});
}
});
}
catch(err)
{
alert(err.message);
}
}

I got the current site url on this but got error on " $(xData.responseXML).SPFilterNode("z:row").each(function()" this session.

Re: how to use spservices framework with fd ?

Posted: 12 Apr 2016
by Dmitry Kozlov