Tag Info

Hot answers tagged

2

You could use the something like const string scriptKey = "jQuery"; if( !Page.ClientScript.IsClientScriptIncludeRegistered( Page.GetType(), scriptKey ) ) { Page.ClientScript.RegisterClientScriptInclude( Page.GetType(), scriptKey, ResolveClientUrl("~/js/jquery.min.js" ) ); } The key to making this work is that you need to include the same key ...


2

I would use the REST API for this for sure and customize the OOTB list form with a typeahead or some other selection mechanism for the lookup. Even a selectable gridview might be better than a typical select. To filter using a typeahead sort of functionality you would use var filterString = "?$filter=startsWith('" + valueUserTyped "',Title)"; var ...


2

You can run the REST query in the browser to time it I have a list with about 30k items and rest works Okey but I don't select all of them though. I'd personally try angularJS together with the REST query to enable filtering for the users on the list but I'm unsure how well it will perform on such a large amount of items as I've never tried.


2

Ah, it is working, but the URL to the picture is malformed, hence the x images. This is what worked for me: <script type="text/javascript"> $(document).ready(function(){ $("img[src$='icjpg.gif']").each(SetImage); }); function SetImage() { $(this).attr('height','100'); $(this).attr('src','/managedpath/sitename/library/'+$(this).attr('title')); ...


1

There seems to be a problem locating the parent href attribute. I did notice that the object itself has a title attribute. So here is a workaround: <SCRIPT defer type=text/javascript> $(document).ready(function(){ $("img[src$='icjpg.gif']").each(SetImage); }); function SetImage() { $(this).attr('height','100'); ...


1

This looks to be malformed $("#tabs ul").append("<li><a href='"+encodeURI(test.aspx?Myfilter="+$(this).text())+"'>" + $(this).text()+"</a></li>"); try: $("#tabs ul").append("<li><a href='"+encodeURI("test.aspx?Myfilter="+$(this).text())+"'>" + $(this).text()+"</a></li>");


1

SPControl.GetContextSite Method expects HttpContext parameter, so replace the line: SPSite mySite = SPControl.GetContextSite(mySiteUrl); with: var site = new SPSite(mySiteUrl); Secondly, in order to utilize SPEncode class add namespace declaration: using Microsoft.SharePoint.Utilities; Thirdly, there is no need at all to use HtmlTextWriter Class ...


1

Your second query just returns files filtered by File.Name and nothing more. The following examples demonstrates how to retrieve files from a specific folder. How to retrieve Files from a specific Folder using SharePoint REST Assume a Documents library contains Guides folder. Option 1 Using SP.Web.getFolderByServerRelativeUrl Method Endpoint Uri: GET ...


1

Selecting items in folders with the REST API is a bit different than selecting items in the library itself... (like in your first example) The way that I get the items in a specific folder is with the /_api/web/GetFolderByServerRelativeUrl("<serverRelativeFolderUrl>")/files endpoint... So in your example, you want everything in ...


1

Scriptlink works as well, just remove OnDemand="true" which requires calls to SP.SOD.execute or SP.SOD.executeFunc methods for any JS script referenced to execute. Detailed explanation has been posted here before: jQuery not being loaded from master page The above works provided if your jquery reference path is correct!


1

Check out this article on ITUnity: Managing JavaScript References in Office 365



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