Tag Info

New answers tagged

0

I found the solution.Use jQuery instead $.Don't know why it is behaving like this.So now I have assign jQuery to $ and it works. $ = jQuery; alert($('#linkMainImgDiv').html())


0

Because someone already answered to your question, I'll suggest another solution. If you don't mind to use a thrid party library, you can look at my SharepointPlus library. With it you don't need to write the CAML Query but you use a SQL-like syntax for the WHERE clause. In your case, all the above code will look like this: ...


0

Give permission in App at list level. And check that list permission is inheriting from its parent, it should not break. If it break then you must have permission in that list. Check these things, otherwise things should gonna work perfectly!


0

Try alert($('#linkMainImgDiv').html()) First check in you page source that even this id exist or not. If exist then try it in your debugger tool of browser. Can you share your markup or any screenshot with div.


0

OK here is how to proceed (based on http://stackoverflow.com/questions/7370943/retrieving-binary-file-content-using-javascript-base64-encode-it-and-reverse-de): // get the remote file binary content function getBinary(file, callback) { var xhr = new XMLHttpRequest(); xhr.open("GET", file, true); xhr.overrideMimeType("text/plain; ...


1

So if SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult, returnVal) is not working you can try this: Closing the Dialog Autohosted and Provider-hosted Apps for SharePoint are hosted outside of SharePoint, and as such can’t leverage typical SharePoint scripts to close the dialog (ex: SP.UI.ModalDialog.commonModalDialogClose()). Luckily, I ...


1

The below code will help you var context = new SP.ClientContext.get_current(); var list = context.get_web().get_lists().getByTitle("ProjectInformation"); var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml('<View><Query><Where>--your query goes here -- </Where></Query></View>'); var collListItem = ...


0

David - After adding the document content type/s to a library, add the library to a web page and set its toolbar to display. From there you can grab the code for the new button/template from the page's source code and paste into a CEWP. For step-by-step instructions view my post on creating links to document content type templates here: ...


0

first off, its a sharepoint app part. Secondly i understand you gave control but where? have you given control though the app part? first edit the app part by going to properties -> now select the permission on the left side to show you the permissions for the application part. You should see several dropdowns, I presume the app part is only trying to ...


0

In order to update JSLink property of a View, the following conditions must to be met: proper View resource endpoint url, for example: /_api/web/lists/getbytitle('listTitle')/views/getbytitle('viewTitle') entity type for View resource set to : '__metadata': {'type': 'SP.View'} How to update List View using SharePoint 2013 REST function ...


0

Tips to consider. 1. Are you declaring a list to be created whe the app launches?if so make sure you dont have spaces etc.. in the name of you custom site column,CT etc...(NOt Display name) 2.Have you removed/include SP.js etc file from you webpage? coz that can cause you not to get your client context. create an empty app and see if it works..and as ...


1

You could of course nest it, but there is a built in function SP.SOD.loadMultiple. SP.SOD.loadMultiple(['sp.js', 'callout.js'], function() { });


0

get_item('Author'); should return a user object. Simply use the get_email() method to get the user email: var ctx = new SP.ClientContext(); var list = ctx.get_web().get_lists().getByTitle('My list'); var item = list.getItemById(1); ctx.load(item); ctx.executeQueryAsync(function(){ alert(item.get_item('Author').get_email()); }, /* error handling here ...


1

var clientContext, hostweburl, parentContext, parentWeb, listItems; clientContext = new SP.ClientContext.get_current(); hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); parentContext = new SP.AppContextSite(clientContext, hostweburl); parentWeb = parentContext.get_web(); var id = GetItemID(); // Gets Selected item's ID var listId ...


3

var clientContext = SP.ClientContext.get_current(); // Gets current site context var id = GetItemID(); //retrieve selected list item id to update data var listId = SP.ListOperation.Selection.getSelectedList(); var oList = context.get_web().get_lists().getById(listId); this.oListItem = oList.getItemById(id); function GetItemID() { var selectedItems ...


0

Hi to get the data from the custom SharePoint list you can use the lists.asmx webservice. You can do something like this (function ($) { //Get Elements from a custom list var ListName ="Custom "; var url = document.URL; if (url.indexOf("https://") != -1) { var urllink = document.location.href.replace("https://", ""); var prefix = "https://"; ...


0

try the below code, it works for me: ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "msg", "window.frameElement.cancelPopUp();", true);


0

Following code worked for me. this.Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "SP.UI.ModalDialog.commonModalDialogClose(0, 0);", true);


1

$(document).ready(function() { ExecuteOrDelayUntilScriptLoaded(function getData(){ //your code to get data from sharepoint list. }, "sp.js"); }); load sp.js and then your code to retrieve list data http://msdn.microsoft.com/en-us/library/office/jj245759(v=office.15).aspx


0

You may just need to specify your custom column in the request. Replace: context.load(items); With: context.load(items, 'Include(owl)');


-1

Using JQuery if($("#MSOLayout_InDesignMode").attr('value')== "1") { }


0

The issues appears to be that rather than 'creating' a new record within the viewField, you instead 'update' the existing record. Replacing the REST.build.create class with REST.build.update seems to resolve the issue.


0

you can get the web id easily.. use below code to get it. <script src="/_layouts/15/SP.Runtime.js"></script> <script src="/_layouts/15/SP.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script> <script type="text/javascript"> ...


0

I'm afraid you might not be able to retrieve accurate count because of the nature of the BCS queries which only return a Maximum of 2000 records normally. I would recommend you read this article http://social.technet.microsoft.com/wiki/contents/articles/9628.sharepoint-2010-row-limits-in-external-lists.aspx Also one other potential way to read that ...


2

For getting the pages you could utilize the same REST endpoint that is used for getting List Items, for example: http://<site url>/web/lists/getbytitle('<list title>')/items(<item id>) JavaScript Example function getListItem(webUrl,listName,listItemId, complete, failure) { $.ajax({ url: webUrl + ...


0

You can actually use Christophe's HTML Calculated Column, please have a look at following question: how to show HTML code in column? So based on average of a column, you build up your HTML in calculated column to show the image and you put the JavaScript that does the magic to convert that String representation of HTML to actual HTML.


0

Do you have more that one web front end server in your SharePoint environment?


0

I had a similar issue once. What helped me is placing the js-File in the SiteAssets and referring it from there. What also helped was using jQuery instead of $ in front of every jQuery command and using _spBodyOnLoadFunctionNames.push("MyFunctionName"); function MyFunctionName() { // Code } to make sure all the other js-Files were loaded before ...


1

Imagine you and I both open the edit form of a list item. You update a client's address, and I update his phone number. You hit the save button first, and I hit it a few seconds later. What should happen when I hit save? Should the old client address present on my edit form overwrite your change and set it back to the old value? Actually, SharePoint will ...


1

In JSOM API use SP.Taxonomy.TaxonomyFieldValue.wssId property to get the list item ID of the list item containing the taxonomy field value that is encapsulated by the TaxonomyFieldValue object. Example var listTitle = 'Contacts'; var listItemId = 1; var taxFieldName = 'Country'; var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); var list ...


1

To change the locale for a specific site, go to the Site Settings area and select Regional Settings from the Site Administration group of links. For more options you can check: http://blog.funknstyle.com/2012/08/working-with-date-formats-in-sharepoint-2010/


0

Using self parsing code, I can find my query using : // In a global utility.js file (function () { window.UrlQuery = window.UrlQuery || (function () { var result = { hash: {}, query: {} }; var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i ...


0

Thanks for the answer guys. Didn't know that it was created as a subweb. Solved it with comparing the subwebs url with the hosturl and filtering out the apps that way.


2

I accomplished this by using the following als document link, if the user clicks it the document is opened in the online word viewer. Depending on your server configuration, this might not work for all file types. [site URL + Library location]/_layouts/WordViewer.aspx?id=[document URL]


0

The special website to which the app is deployed is called an app web. The website to which the app is installed is called the host web. Although the app web has its own isolated domain, it is in the same site collection as the host web. (One exception to this rule is when the app is installed with tenant scope. In that scenario, the app web is in the site ...


2

you can reference scripts in the masterpage of this forma: <SharePoint:ScriptLink language="javascript" name="custom.js" OnDemand="true" runat="server" Localizable="false" /> Referncing a java script inside my master page will not fire


0

i know why this doesnt work, as the link states to put it in the head section! but i presume that you dont have a head section so you would add it to the masterpage! either referencing the JS file or inline. Inline means adding it directly to the masterpage. you never stated how your creating the page! is it a webpart or just a single aspx page with no ...


0

You can either add directly into the sharepoint page where sharepoint list sits using content editor webpart, or use Script editor webpart. You can also inject javascript in list view webpart using JSlink.


0

Try adding the code in content editor web part.


0

I faced some issues using the $ sign. Try using jQuery instead of $ in your javascript code.


0

You can try to setup WebId property of XsltListViewWebPart


0

What is it you're trying to achieve here and why does that tutorial make it so unnecessarily complicated?? If you simply want to add some custom JavaScript or jQuery-enable your site, then simply reference them in the masterpage using tags as already stated. Then in your custom.js add any functions you want to occur after page load into ...


0

You can retrive list item with javascript object model and get the field value from list item: http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx


1

SharePoint:ScriptLink requires you to use SP.SOP.execute in order to load the script. Like this (reference): SP.SOD.executeOrDelayUntilScriptLoaded(myfunction, 'sp.js'); function myfunction() { // my custom code // SP.SOD.executeOrDelayUntilScriptLoaded(myfunction2, 'custom.js'); //change } SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs("sp.js"); ...


2

Most probably the specified error occurs since you are trying to get site-level Content Type while web is not a root web. Quick fix Replace the line: var docsetContentType = web.get_contentTypes().getById(docSetContentTypeID); with: var docsetContentType = ctx.get_site().get_rootWeb().get_contentTypes().getById(docSetContentTypeID); How to ...


0

Apparently, .NET wants to ensure that what went down with the control is the same thing that came up with the control (ie, make sure that nothing malicious was added to the results coming back from a server-created control). As a result, you can disable the EventValidation, as you did. Visual Studio, then, no longer gives you the error because it's not ...


2

In SharePoint 2013 was introduced new permission level Remote Interfaces Permission that in particular prevents anonymous users from accessing CSOM interface. How to enable CSOM for Anonymous Users Go to Central Administration Go to Manage Web Application Select your Web App Click on Authentication Providers in the ribbon Click zone "Default". Uncheck ...


-1

If you have more than one instance of the same app in a farm and the user is using both at the same time you will overwrite your cookie...


0

If you simply want to hide, use the following CSS: li.ms-core-menu-item[text="View Properties"], li.ms-core-menu-item[text="Edit Properties"] { display: none !important; } Add a content/script editor to the page and embed the css. If you want to hide it in the entire site collection/site, add the CSS to your master page.


0

If you want to force this type of behaviour for users, then F.Aquino's solution is what you need. Otherwise, there is one out-of-the-box solution for users: use the "Focus on Content" button on the top-right side of the ribbon.



Top 50 recent answers are included