Hot answers tagged

16

Juergen, The below article should help: http://blog.collabware.com/2013/03/22/tips-tricks-sharepoint-2013-modal-dialogs/ You have SP.UI.ModalDialog.showWaitScreenWithNoClose which can be used.. function RequestEnded(sender, args) { try { waitDialog.close(); waitDialog = null; } catch (ex) { } }; function RequestStarted(sender, args) { ...


12

SharePoint is a huge historical monster. Core of the current paging implementation was introduced long ago, probably in SP2010 or even earlier. That's why your approach doesn't work: SharePoint isn't finding some html elements that are supposed to be there, and falls back to a simpler approach with link. Investigation Here is why it happens (you may skip ...


10

You need to call close() on object returned from showWaitScreenWithNoClose(). This works for me: var loading = SP.UI.ModalDialog.showWaitScreenWithNoClose(SP.Res.dialogLoading15); loading.close();


9

Ajax has nothing to do with jQuery per se. https://en.wikipedia.org/wiki/Ajax_(programming) http://blog.garstasio.com/you-dont-need-jquery/ajax/ http://caniuse.com/#feat=xhr2 jQuery has a function which wraps around JavaScript native 'Ajax' calls $.ajax({ type: "POST", url: "webservice", data: "a=1&b=2&c=3", success: function(d) ...


8

I was able to add a file with SP.RequestExecutor <%-- _lcid="1033" _version="15.0.4128" _dal="1" --%> <%-- _LocalBinding --%> <%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" ...


8

This error occurs since tag variable is not defined. About eTag When updating or deleting items within SharePoint lists via REST you must specify the Entity Tag (eTag) value that was returned with the item during the initial query. This enables SharePoint to determine if the item has changed since it was requested. Alternatively you can tell ...


8

Are you talking about SP 2010? Then you can use either the REST API or you can use the Client Object Model.


7

You can use the ECMA Script Client Object Model: ExecuteOrDelayUntilScriptLoaded(loadWebs, "sp.js"); function loadWebs() { var clientContext = new SP.ClientContext.get_current(); this.webs = clientContext.get_web().get_webs(); clientContext.load(this.webs); clientContext.executeQueryAsync(Function.createDelegate(this, ...


7

The OData provider for the REST API is configured to limit the number of items in a response to 100. It protects against developers inadvertently making a request that returns large result sets. If there are more items the response will contain a continuation. In a JSON response the continuation will be a property named __next. You can use $top if you ...


6

You call your method showWaitScreenWithNoClose using asyncronously with callback ExecuteOrDelayUntilScriptLoaded. If sp.js is not loaded, then closing event can fire before the wait dialog is showed. Your code should look like this: var waitDialog = null; function BuildTable() { ExecuteOrDelayUntilScriptLoaded(function() { waitDialog = ...


5

You cant add a WebMethod to a webpart. A webpart is a server control and outputs html to the page. If you want to use webmethods I would create a web service and consume this in the webpart or by other pages / controls. For these scenarios, we usually have an Application Page which defines all the WebMethods.. And than you can use the ...


5

Here is an example that demonstrates how to query all search results using SharePoint 2013 Search REST API: function search(webUrl,queryText,rowLimit,startRow,allResults) { var allResults = allResults || []; var url = webUrl + "/_api/search/query?querytext='" + queryText + "'&rowlimit=" + rowLimit + "'&startrow=" + startRow; return ...


4

You need to use the $expand option in your query string. siteUrl + "/_api/lists/getbytitle('" + listName + "')/items?$select=NameOfLookup/FieldYouWant&$expand=NameOfLookup/NameOfFieldYouWant" So yours would be: "/_api/lists/getbytitle('" + listName + "')/items?$select=$expand=status_x0028_test_x0029/Title&$expand=status_x0028_test_x0029/Title ...


4

Your issue is in understanding the async nature of JavaScript. The reason why there are no values is because you are attempting to access it before the executeQueryAsync function has returned and done it's job. Any logic that needs to access the values in globalTitle needs to be abstracted into a function or functions that can be invoked inside of the ...


4

I think that calling ASP.NET page method from a jQuery requires that the method being called be marked static and with the [WebMethod] attribute. Also, please note that jQuery can call ASP.NET page methods. Methods in a SharePoint Visual WebPart are technically user controls. Here is another question that covers this topic. As noted by Tim Ebenezer in ...


4

Here is how I proceed : I bind the click on the SAVE/OK buttons with jQuery, and do my stuff, and then I trigger the original code. // bind the Save/OK buttons $('input:button[id$="_diidIOSaveItem"]').each(function() { var $this=$(this); // save the "onclick" action to call it later $this.data("on-click",$this.attr("onclick")); // remove the default ...


4

What about using the Add method: If for example using SiteCollectionDocuments in a Site Collection 'url' : _spPageContextInfo.siteAbsoluteUrl + "/_api/Web/Folders/add('SiteCollectionDocuments/newfolder')" This shouldn't require the data payload 'postData'. See more here: ...


4

Make sure the correct ServerRelativeUrl has been provided, the following formats could be specified: Server-relative URL: /<web url>/<list url>/<folder url> Site-relative URL: <list url>/<folder url> For example, to create a folder named Orders in a Documents library in a sub site Projects, you could specify: ...


4

It's throwing the error because the <asp:ScriptManager> tag is most likely defined in your master page, causing two instances on the page you are trying to load. http://social.msdn.microsoft.com/Forums/br/sharepoint2010general/thread/54c271ee-de71-4e47-b02b-29a1d540b81c


4

I just did a test with SPServices where I set a Single line of text column to an empty string (""), which seemed to work just fine. This was with WSS 3.0 (the simplest test case, IMO). $().SPServices({ operation: "UpdateListItems", async: false, debug:true, listName: "Sales Opportunities", ID: 5, valuepairs: [["StateID", ""]], ...


4

jQuery is one way to do this (feels like everyones choice nowadays). Since you're using a Visual Web Part an ASP.NET Timer control in combination with an UpdatePanel might be a preferred choice in your case, that will also fix both your problems; delay load and refresh.


3

I would recommend that your teams build all their products against version 3.5 of the .NET framework. If necessary you can map DLL versions in your web.config file using bindingRedirect to use the newer version of AJAX Extensions. You might need additional SafeControl entries if you have multiple versions.


3

The service needs to be AJAX enabled to generate a javascript proxy for you. Lists.asmx is not AJAX enabled. [WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1), WebService(Namespace="http://schemas.microsoft.com/sharepoint/soap/")] public class Lists : GenericService, ISoapServiceLists, ISoapServiceListData, ISoapServiceListSchema, ...


3

Since it is an intranet, I think worrying this much is a little over the top. I guess with fiddler around, anyone can modify their ajax response to the server, so I guess I'm not really following you about why an update panel is more secure than another implementation (such as icallbackeventhandler)? Are you counting on the postback security validation ...


3

Have a look at http://blog.jsonpify.com/ or, as suggested on the blog above, have a look at http://developer.yahoo.com/yql/ YQL can be called from client script using JSONP, allowing you to pass a SQL-ish query against an "Open Data Table". An Open Data Table is an abstraction layer similar to a BCS model in SharePoint. An Open Data Table abstracts web ...


3

See if these paths to the row count variables work: data.d.query.PrimaryQueryResult.RelevantResults.RowCount data.d.query.PrimaryQueryResult.RelevantResults.TotalRows If you have specific questions about the object model, I find that the best first point of reference is to look at the returned xml or json using web developer tools and looking at the ...


3

I've done ajax a few different ways. When deving webparts I usually try to use the ICallbackEventhandler (http://msdn.microsoft.com/en-us/library/system.web.ui.icallbackeventhandler.aspx), especially when creating webparts that need ajax. I've also had a scenario when I used an update panel ...


3

SharePoint works great with AJAX. Two of the great improvements for SharePoint 2010 was Client Side Object Model and REST interface which makes JavaScript development against SharePoint a lot easier that using the old Web Services. Another great option which makes a the Web Services usable and provides a lot of great functionality (and good documentation) ...


3

After reading up and a lot of fiddling i came up with setting the data attribute to the file and processData to false. This worked great, except for dropfile not supporting readAsArrayBuffer. So i used the above convertDataURIToBinary function. Now i have this and it works great. Remarks: files.data is added on the load event and i had to turn async of ...


3

There's a lot of advice given here, but your real problem is with parsing the XML that has been returned from you. The problem is with this call: $(xData.responseXML).find("z\\:row, row"). That is no longer supported AT ALL with jQuery 1.5+ in a cross browser way. You say you are using 1.4.2, but I strongly suggest you verify the version you are using by ...



Only top voted, non community-wiki answers of a minimum length are eligible