Tag Info

New answers tagged

0

CopyTo does not appear to be supported for folders in the REST API. See the Folder Methods section of Files and folders REST API reference


0

I believe I have everything wired up correctly, but I'm getting this error: Uncaught Error: [$injector:modulerr] Failed to instantiate module app1 due to: Error: [$injector:modulerr] Failed to instantiate module ui.router due to: Error: [$injector:nomod] Module 'ui.router' is not available! You either misspelled the module...<omitted>...9) ...


1

Where have you placed the content editor webpart???, Try palcing the CEW at the bottom of the page. I mean edit web part--> Layout--> Zone Index Change this to a different number so that the CEW appears on the bottom of the page


0

You can access your callback method from modal page. Add callback to your parent page to catch the close event function CloseDialogCallback(dialogResult, returnValue) { SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.RefreshPage', SP.UI.DialogResult.OK); // Add your code to clear the save state. } And call CloseDialogCallback method from ...


0

How are you fetching values for left side list box? Anyway you should be able to do this using normal html list box and javascript to move items left to right.


2

according to MS, ImageURL is Optional Text. Specifies a virtual server relative link to an image that presents an icon for the item. which means you should probably start with ImageURL="/myPics/myIcon.ico" or ImageUrl="/_layouts/images/workflows.gif" as already stated, try to use an ootb icon so that you can troubleshoot not the image format ...


1

If you just need to access the values, you could do it like this: var dispTitle = "APickerField"; var pickerDiv = $("[id$='ClientPeoplePicker'][title='" + dispTitle + "']"); var peoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[pickerDiv[0].id]; peoplePicker.GetAllUserInfo(); The GetAllUserInfo() returns an array with one index pr ...


0

I've had this problem before and never explored a solution until now. Don't use the script editor, instead just open the view aspx within SharePoint Designer and in 'PlaceHolderAdditionalPageHead' you can add your script without loosing the ribbon. Tested in SP 2013 on AllItems.aspx <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" ...


1

I ran into a similar scenario where I had to set specific authors, since you included a powershell code sample here is the powershell I used to make the changes. Be aware this goes through all posts and asks if you want to change the author on each one. It also changes the editor as well. Please take the time to read the script before using, and be sure to ...


2

Don't add View Tag, reform the query as follows: CAMLQuery = "<Query><OrderBy><FieldRef Name='Fiscal_x0020_Year' Ascending='TRUE' /></OrderBy></Query>"


0

The initial blog post is set as the system account, all subsequent posts will show as the person who creates the post. Simply delete the initial blog post if it isn't necessary.


1

Perhaps its the default RowLimit that is causing you to not retrieve all results? A RowLimit of 0 will return all results. For example: "<View><Query><OrderBy><FieldRef Name=\"Fiscal_x0020_Year\" Ascending=\"TRUE\"></FieldRef></OrderBy></Query><RowLimit>0</RowLimit></View>" Also, the following ...


1

Try adding a null check: CAMLQuery = "<Query><Where><IsNotNull><FieldRef Name='Fiscal_x0020_Year' /></IsNotNull></Where><OrderBy><FieldRef Name='Fiscal_x0020_Year' Ascending='True' /></OrderBy></Query>"


0

Here is a short hint for your solution: HTML: <input type="button" id="test" value="klick"></input> <label id="label"></label> JavaScript: document.getElementById("test").onclick= function (){ var person = prompt("Please enter your name", "Harry Potter"); if (person != null) { //do some stuff if ok is clicked and value entered ...


2

Your example contains the following errors/typos: To get fs object type use the following syntax: var fsObjType = selectedItem.get_fileSystemObjectType(); Another point is, ListItem object have to be requested first before getting it's value, this is why in your example it will not work. In fact, you don't have to request ListItem object in order ...


0

I have found the error. Let me first explain how I found it: I recreated the scenario found at the project wiki, but without bothering about any extra options, like is this field required, whats the max length of this property and so on. After this I added the code from the linked wiki into the newform.aspx. After calling up this form in the browser I ...


2

Did you even try to google? http://mysharepointlearnings.wordpress.com/2013/11/20/knockout-js-with-sharepoint-2013-app-ii/ There are plenty of results regarding your problem.


1

Have you seen this post: Filter out items in list view using jslink Looks like you could do: overrideContext.Templates.Item = customItem; function customItem(context) { if(conditionIsNotMet) { return RenderItemTemplate(context); } else { return ''; //Hide Row somehow } } HTH


1

Have you tried adding the "parentColumn" option also? This is something I tried a while ago and wrote some comments that may be helpful. //State - County Dropdown list $().SPServices.SPCascadeDropdowns({ relationshipList: "County", //Top List County and States columns relationshipListParentColumn: "Title", //State column in the Top List ...


0

The html option takes a DOM element rather than a string because of which you get this error. Try something like this: var htmlElement = document.createElement('p'); var messageNode = document.createTextNode('Message'); htmlElement.appendChild(messageNode); var options = { html: htmlElement, autoSize: true, allowMaximize: true, title: ...


3

On Demand scripts are the one which we load only when we need it in a page. We put a reference to it but it won't load until we call for it instead of the usual one which gets loaded every time the page loads. A very good blog on this could be found here ExcuteOrDelayUntilScriptLoaded does not trigger loading an on demand script (SOD)! It schedules an ...


1

I too think this is an out of order script loading. Although: this is the first time I'm hearing about jQuery interfering with core.js and others. Because CEWP are inserted into the Body other page - thus after the HEAD script files - is what makes doubt this is a timing issue. SP (2013... And maybe 2010 too) uses a global variable called $, so maybe ...


1

You'll get an array back if you use loadQuery rather than load. In the example below allDocs is an array. var targetList = ctx.get_web().get_lists().getByTitle('Shared Documents'); var query = SP.CamlQuery.createAllItemsQuery(); var queryResults = targetList.getItems(query); var allDocs = ctx.loadQuery(queryResults);


1

You can get the document link using following line: var url = _spPageContextInfo.webAbsoluteUrl + oListItem.get_item('FileRef');


1

You may use cross-domain Ajax with JSON-P/JSONP, it was created specifically for this reason. Here are some references to get you started. If you need more specific examples, please let me know: http://en.wikipedia.org/wiki/JSONP http://json-p.org/ http://stackoverflow.com/questions/2067472/what-is-jsonp-all-about I also have this image - I'm not the ...


0

Please look at the EncodedAbsUrl, FileDirRef, and FileRef properties. The one you use depends on your needs but I suspect you'll want EncodedAbsUrl or FileRef. Here is an example of what each returns: EncodedAbsUrl: http://yourserver.com/Pages/home.aspx FileDirRef: /Pages FileRef: /Pages/home.aspx var ctx = new SP.ClientContext(siteUrl); var items = ...


0

you are trying to add multiple scripts to a loading page, which will conflict with other scripts. my advice is to add them to the master page, or if you want to use them in a single page, at least add them to the PlaceHolderAdditionalPageHead of the current page, which is sequentially after core.js if you insist in having them in the CEWP, try defer


0

I wouldn't say disable, but it can block it from being loaded properly. If there occur syntax errors and such in one or more files then yes, it could potentially "disable" core.js - but it depends on the version of SharePoint (2010 or 2013?) First I would suggest that you check the console log in IE using the WebDeveloper tool (F12) to see if any ...


0

To fix this, and thus making my SharePoint Site very bland I change back from IE=9 to.. <meta http-equiv="X-UA-Compatible" content="IE=8" />


2

The default format for SharePoint REST endpoint is application/atom+xml. Instead of manipulating results returned in Xml format you could specify JSON format. Use accept header to specify the format for response data from the server. To get the results in JSON format, include an Accept header set to application/json;odata=verbose. Examples The code in ...


0

You can get the result as an ArrayList using SP.ClientObjectCollection.data Then you can access properties like this: var listEnumerator = allDocs.get_data(); listEnumerator[0].get_item("FileLeafRef") Edit: If you want an array with only FileLeafRef, you could do something like this: var myArray2 = new Array(); allDocs.get_data().map(function(item) ...


0

this is a very rough example but I think you get the idea locate the add new item(s) for each one of them, replace the link by an image (or anything else) move the element from the bottom to a parent element <!-- change add new item markup for all webparts in page and move them around --> <script type="text/javascript" src="../Style ...


0

Is it possible to use SharePoint cross-domain library in a page totally external to SharePoint No, the Cross-domain library for apps for SharePoint is part of SharePoint, it is not available outside of SharePoint. Here is an example of someone else who had the same requirements. ...


0

This is not default functionality in SharePoint. If you need this functionality you will have to create it yourself in Visual Studio. Easiest will be to create a delegate control that keeps a list of key/value pairs. Key being the username and the value the date and time of the last pageload of that user. Store the list in the Session object. With every ...


1

I would use a content editor web part with a text file for a content source, then put a style tag in there and not use JavaScript at all... <style> TH.ms-vh2:contains('Title') { min-width:250px; } </style> You could also do this by editing the HTML Source directly in the content editor, but I find SharePoint thinks it knows ...


0

Try declaring collListItem outside the scope of the function and removing the 'this' keyword from the line: this.collListItem = oList.getItems(camlQuery); For example: var collListItem; function retrieveListItems(siteUrl) { var input = document.getItemById('siteDrop').value; var clientContext = new SP.ClientContext(siteUrl); var ...


0

Interesting - the 2013 behavior uses a function in the blur event of the search box to populate or hide the term 'Search...' as appropriate -- I'm guessing to support old IE versions instead of using the placeholder property... So! What you need is: //use this instead of immediate or jQuery ready because we want to manipulate SP generated markup ...


1

There is a JavaScript function in SharePoint called "PreSaveAction" that is fired just before the item is validated and saved. You can use this function to call your function. For example: function PreSaveAction(){ SendProject('http://site.com/subsite/Lists/Projects/{@ID}_.000'); return true; } I've used PreSaveAction before for client side form ...


1

I would use the CodePlex SPSERVICES project (http://spservices.codeplex.com/), which is compatible with SharePoint 2007. SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works ...


1

If you're using pure javascript, the easiest way is to add the field back to your page, hide it with a css style or some other javascript, then read the field value directly. If you need, you can edit the Dataview Webpart in designer to give the tds in that particular column a special class or something to make it easier to select.


2

The dataview web part is executed server side, so you can't use jQuery to manipulate the SelectCommand. You would need to remove rows from the DOM with jQuery after the web part has loaded. I would use jQuery to hide the web part initially. Then, make your SPServices call to get the user's Office. Then iterate over each row of the table and if the Office ...


0

For LOAD: Reference: http://www.codeproject.com/Articles/399156/SharePoint-Client-Object-Model-Introduction ClientContext context = new ClientContext("http://test.com"); List list = context.Web.Lists.GetByTitle("Tasks"); context.Load(list); context.ExecuteQuery(); Console.WriteLine(list.Title); Console.ReadKey(false); In above ...


0

Your loop is strange.... I guess your code should look more like that: SP.SOD.executeFunc('sp.js', 'SP.ClientContext', startProgram); function startProgram() { var clientContext = new SP.ClientContext.get_current(); var oList = clientContext.get_site() .get_rootWeb() .get_lists() .getByTitle('NBS Calendar'); var camlQuery = new SP.CamlQuery(); ...


2

When entering HTML content into a SharePoint page or web part, it will always modify the markup using SharePoint's black box. There is, however, a workaround that might work for you: 1) Use a Content Editor web part (you can insert one into regular page content or a web part zone) 2) Put all of your markup in an HTML or TXT file stored in a document ...


1

var d = new Date("Wed Jul 23 01:00:00 UTC+0100 2014"); getFormattedDateWithOrdinal = function (date) { var d = new Date(date); var curr_date = d.getDate(); var months = new Array("January", "February", "March","April", "May", "June", "July", "August", "September", "October", "November", "December"); var ord = ""; if (curr_date == 3 || ...


0

You have to get the context of the site where you have your list. The below code should work: var context = new SP.AppContextSite(SP.ClientContext.get_current(), 'https://URL/sites/DevSite/'); var list = context.get_web().get_lists().getByTitle('Announcements'); Edit: You will also need to give permission for the app on the site (Host Web). You can do ...


1

I am assuming you need to access host web announcement list, for doing so you need to get client context of the host web even before you do this var list = context.get_web().get_lists().getByTitle('Announcements'); Also, try to do some reading on SharePoint App Architecture. How App Web and Host Web are different.


0

answer can be found here: http://msdn.microsoft.com/en-us/library/office/hh185011(v=office.14).aspx var siteUrl = '/sites/MySiteCollection'; function createListItem() { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('Announcements'); var itemCreateInfo = new ...


0

no need to load the whole web object when you are already getting the user object from the web... you just need to load it into the context when its retrived sucessfully! try ExecuteOrDelayUntilScriptLoaded(getWebUserData, "sp.js"); var context = null; var web = null; var currentUser = null; function getWebUserData() { this.context = new ...


1

Hiding the Ribbon : In your master page, find the SharePoint ribbon by looking for the line of code that begins with . Place the SPSecurityTrimmedControl code around your ribbon to conditionally hide it based on user permissions. In my example, i've hidden the ribbon from any user who doesn't have the ManagePermissions ability, which is going to be almost ...



Top 50 recent answers are included