Tag Info

New answers tagged

1

Found the solution. All it took was replacing this bit of code: var h3 = '<h3>' + oListItem.get_item('Title') + '</h3>'; var div = '<div>' + oListItem.get_item('Floor') + '</div>'; var content = $(h3 + div); content.appendTo("#accordion").show(); with this bit of code var newDiv = "<h3> " ...


0

In order to solve this i just added the Jquery library to my master page. this way it got loaded before my webparts.


0

As far as where to start you need to define what your goal is. What you do / don't want to see when they open form on iPhone in particular. If you are using SP2013 with Enterprise CAL's then you have access to design manager and device channels which make it pretty easy to drop in a different look just for iPhone or other mobile users. This approach ...


0

I found the solution my self. Thanks everybody. AddPostRenderCallback(ctx, function() { if(uniqueDivId.value == itemId) { $('#' + itemId).show(); } });


0

I think you are missing the "#" sign, that jQuery needs to interpret uniqueDivId as an id. jQuery('#' + uniqueDivId.value).toggle(); http://stackoverflow.com/questions/743994/how-do-i-select-an-element-in-jquery-by-using-a-variable-for-the-id


0

You can use $("#yourID").show() and $("#yourID").hide().Simple Hide JSFiddle


0

The following should work, note it does not save any changes when you click it, it just takes you to the next item. I placed it in a Snipped webpart (Sharepoint 2013) on the eidt page, but you could use SharePoint designer as well. You will need to update the url portion of the a tag to reference your own site, although there is probably a way to pull this ...


2

Here's something that will get you started. function GetKeywordFromUrl() { var hashValue = window.location.hash; if (hashValue) { var k = hashValue.split('#k=')[1]; if (k) return decodeURIComponent(k.replace(/\+/g, " ")); //For executing keyword/filter search from a textbox var txtSearch = ...


1

Is the stuff with promises important? If not why not just use 'Include(AllProperties)' to include the properties and do something like this: var context = SP.ClientContext.get_current(); var webs = context.get_site().get_rootWeb().get_webs(); context.load(webs, 'Include(AllProperties)'); context.executeQueryAsync(function(){ var enumerator = ...


5

This is because disabled fields are actually not posted (they are not included in the post at all). Instead try readonly attribute.


0

Well, adding the code below as a new function to the SPServices.js file, will work. The new function name is SPGetLastItemIdAnyUser : // Function to return the ID of the last item created on a list. $.fn.SPServices.SPGetLastItemIdAnyUser = function(options) { var opt = $.extend({}, { webURL: "", // URL of the target Web. If not ...


0

You should not use the file name in ExecuteOrDelayUntilScriptLoaded. but the function you want to trigger. Try this in your masterpage (2010) ExecuteOrDelayUntilScriptLoaded(function(){ var lcid = SP.Res.lcid; if(lcid == "1033") { alert('English'); /* Works only, if it in script editor and page is in edit mode */ } }, "sp.js")


0

This should help you: Find and Delete Orphaned Alerts in SharePoint


0

I have written a feature that when activated at the Site Collection Settings, will inject the jQuery library into the Masterpage using a delegate control. That way you can add the library on a site by site basis. Bismarck


-1

You can load the jquery library within each web part. We experienced the same problem and this was the only solution that worked. The master does not load until after the web parts have loaded.


0

This specified error that is encountered in Chrome browser, could be eliminated by using SP.SOD.execute(key, functionName, args) Method. Replace the line SP.UI.ModalDialog.showModalDialog(options); with the SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);


0

From what I understood was: Do you want to show different Forms for some users. Use jquery to know the person, and separate items by divs. For example in jQuery: $(document).ready(function(){ If(people == 'Admin'){ $('#tableAdmin').show(); $('#tableUser').hide(); }else{ $('#tableAdmin').hide(); $('#tableUser').show(); } } Inside the Form, you open ...


1

Create 4 fields: NewDate as Date only FixedHr as Number limited to max-min of 10-17 FixedMin (Boolean or Yes/No) Calculated Field to Concatenate the 3 fields above. Something like: =Concatenate(NewDate, FixedHr, ":", FixedMin)


0

I found the problem. The date is expected to be in the format yyyy-mm-ddThh:mm:ssZ, and searchq needs to use var searchq = "(Write>='2014-02-26T00:00:00Z' AND Write<='2014-05-26T00:00:00Z') AND


1

Should your query type be STRING and not MSSQLFT (SQL Syntax is deprecated). I assume you are using SharePoint 2010. For the KQL, change the query to something like write:02/27/2014..05/27/2014 or write>02/27/2014 AND write<05/27/2014 (either should work). Did you know you can also use cool variables like write:"last month" according to Michael ...


0

OK. It works now. I'am not sure why but the last steps I did was setting the Site back to the default site definition and restartet the server. Than I've added jQuery like described in this answer from Robert Lindgren: Adding jQuery to master page However... thank you Aveenav.


0

Try loading the jQuery using Html script link at the bottom of the head tag (or after OOTB scripts). Better yet, load it from CDN and provide a fallback. <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script> <script type="text/javascript" > // Fallback ...


0

The following example demonstrates how to retrieve an additional information about selected items: function getSelectedItems(success,error) { var context = SP.ClientContext.get_current(); var listId = SP.ListOperation.Selection.getSelectedList(); //selected list Id var selectedItemIds = SP.ListOperation.Selection.getSelectedItems(context); ...


2

I would recommend that you have a look at SPServices. They have a method that fits your need http://spservices.codeplex.com/wikipage?title=%24().SPServices.SPFindPeoplePicker


2

The usage of jQuery document.ready in SharePoint isn't enough to guarantee that the page has been fully loaded. In place of the document.ready function, it's suggested that you use the native _spBodyOnLoadFunctionNames array, like in the following code snippet: _spBodyOnLoadFunctionNames.push("callMeWhenReady"); function callMeWhenReady(){ // your code ...


0

Name property value (claim format) should be encoded, for example using encodeURIComponent function or as an alternative you could specify UserName property instead: /_api/Web/SiteUserInfoList/items?$filter=UserName eq 'username@tenant.onmicrosoft.com'


0

You need to change the # in the username to %23. http://spsite/_api/Web/SiteUserInfoList/items/?$filter=Name eq 'i:0%23.w|bs\user'


3

Since you mentioned SPServices, below is demonstrated how to query list item by file name using GetListItems operation: function fileExists(webUrl,listName,fileName,result) { $().SPServices({ operation: "GetListItems", webURL: webUrl, listName: listName, CAMLQuery: "<Query><Where><Eq><FieldRef ...


1

What I have working is the following: Method POST URL http://www.somewhere.com/testsite/_api/web/GetFolderByServerRelativeUrl('/testsite/Shared Documents')/Files/add(url='filename.png',overwrite=true) Header Content-Type: application/octet-stream Accept: application/json;odata=verbose X-RequestDigest: ... Body Raw binary bytes (no JSON) Then in ...


2

Without knowing more information about your code, it's hard to make a suggestion. But what I would do is create a query to ListData.svc with the following filter: var queryString = "?$filter=Name eq '" + provisdionalName + "'"; var listUrl = "_vti_bin/Listdata.svc/YourList/$count" + queryString; $.ajax({ type: "GET", url: ...


0

You don't necessarily have to call Caml Query inside loop to get the FileLeafRef here since you already know the IDs of the Documents. You can use SP.List.getItemById(id) method.Please see below code to give you an idea of how to start with: items = []; function getSetListItem() { var clientContext = SP.ClientContext.get_current(); ...


1

Have you tried something like this? <Query> <Where> <Eq> <FieldRef Name='ID' /> <Value Type='Number'>{YourIdGoesHere}</Value> </Eq> </Where> <OrderBy><FieldRef Name='FileLeafRef' /></OrderBy> </Query> <ViewFields> <FieldRef Name='ID' ...


0

When working with User fields via REST API in SharePoint 2010 (listData.svc) you need to specify UserId in Update operation. For example, in Tasks list the column AssignedTo in REST would be referenced as AssignedToId How to update list item using REST API in SharePoint 2010 function updateListItem(webUrl,listName,itemId,itemProperties,success, ...


0

You can get a list description of the code: public String GetDescriptionList(SPList list) { return list.Description; } public String GetDescriptionList(SPWeb web, String listName) { return GetDescriptionList(web.Lists[listName]); }



Top 50 recent answers are included