Tag Info

Hot answers tagged

3

.hide is part of the jQuery framework. Loading jQueryUI won't give you that function. //Load jQuery first <script src="/SiteScripts/jquery.js"></script> //Then jQueryUI <script src="/SiteScripts/jquery-ui-1.8.24.min.js"></script>


3

It appears that the list resides in Host web instead of the App web. In this case the app needs to be given permission to read the List of the host web. Moreover, the REST call needs to be done using cross domain library. Example of cross domain call using REST: executor.executeAsync( { url: appweburl + ...


3

You can add a column render callback when you specify columns definition. "aoColumns": [ { "sTitle": "Shootout By", "mData": "Employee", "sWidth": "10%" }, { "sTitle": "Shoutout Date", "mData": "CreatedOn", "sWidth": "8%" }, { "sTitle": "Title", "mData": "Title", "sWidth": "10%", "render":function (data, type, row, meta) { return ...


2

I don't think you use the correct columns' names. You're using the names as seen by the SharePoint search engine, not the internal names of the fields. For instance, ows_Title should be Title, etc. On the other side, I don't think the nested OR are wrong here, they're just up-side-down.


2

The whole Or section looks wrong, try using BIWUG CAML Designer to craft your query, then use that in your SPServices function. Also, you need to use the internal field names, not the web service returned fields (Description1 vs ows_Description1 etc). http://www.biwug.be/resources Typical nested Ors would look like this: <Where> <Or> ...


2

Yes you need to place following query option CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope="Recursive"/></QueryOptions>"


2

The following examples demonstrate how to retrieve rating information (in Ent. Wiki site wiki pages are stored in Pages library) How to get rating info via SharePoint JSOM API var webUrl = _spPageContextInfo.webServerRelativeUrl; //Enterprise Wiki web site url getListItems(webUrl, 'Pages', function(items) { var ratingsInfo = {}; ...


2

In your Ajax code, we read: url: "/Layouts/SendUsEmail/Handler1.ashx", While it should be: url: "/_Layouts/SendUsEmail/Handler1.ashx", note the '_' in front of "Layouts".


2

When you create or deploy app to the SharePoint it creates a web of its own(even your app may have list and libraries of its own) so app is nothing but a site in your SP, now when you try accessing the your site from this SP App SharePoint won't allow it due to security reasons, and you may get Access Denied error, So to overcome this you need to make a ...


1

You should change your approach. Instead of setting value on Save Click, try setting on change events $('input:radio[name="EventSet"]').click(function(){ var resVal = $('input:radio[name="EventSet"]:checked').val(); if (resVal != undefined) { $('input[title="ResField"]').val(resVal) } alert(resVal); ...


1

I believe you need to use XMLHttpRequest for this var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if (this.readyState == 4 && this.status == 200){ //this.response is what you're looking for handler(this.response); console.log(this.response, typeof this.response); var img = ...


1

Try <script> $(document).ready(function(){ $('#formTbl tr').filter(function () { return !$(".ms-standardheader", this).text().match(/Name|Title/i); }).remove(); }); </script>


1

I am not sure why it didn't worked using hide. One problem might be the script is getting executed prior the table gets loaded. Here is another way to do the same $('.EventRow').css("display", "none");


1

I needed a simple method to determine if there was at least on error in a form field on any of the tabs. Because ms-error is present in the DOM before an error has occurred (people picker), I had to find a different way. Also, because different fields render the error message in different ways, I had to account for all methods in my form. What I ended up ...


1

one way for making sure all 3 levels are expanded <script src="https://portal/SiteAssets/jsLibrary/jquery.1.9.1.min.js" type="text/javascript"></script> $(document).ready(function () { // Wait until SP.JS has loaded before calling expandAll ExecuteOrDelayUntilScriptLoaded(expandAll, "sp.js"); }); function expandAll(){ ...


1

You could use the following endpoint for getting Folder permissions: /_api/Web/GetFolderByServerRelativeUrl('<folder url>')/ListItemAllFields/RoleAssignments Example The following example demonstrates how to retrieve permissions details including Member and RoleDefinitionBindings info for a Folder and print it: function getJson(url) { return ...


1

Here is a working version of your code: $(document).ready(function () { SP.SOD.executeFunc('sp.js', 'SP.ClientContext', readyFunction); }); var isSiteAdmin = false; var isWebAdmin = false; var context; var web; function readyFunction() { $.when(isUserSiteAdmin(), isUserWebAdmin()).done(hideSiteManagerField) } function isUserSiteAdmin() { var ...


1

I always use this regarding deferreds, sure there will be a better looking way but it always works for me: function fxRun() { Step1().then(Step2); } With: function Step1() { var dfd = $.Deferred(function () { setTimeout(function () { //your code here to determine isWebAdmin dfd.resolve() }, 2000); }); ...


1

Azure AD Graph API in particular Get Contact operation allows to access contacts from Global Address List: GET https://graph.windows.net/mytenantdomain/contacts?api-version=2013-04-05 HTTP/1.1 Authorization: Bearer <token> Content-Type: application/json Host: graph.windows.net Follow Accessing Azure Active Directory Graph Information article that ...


1

I wonder if SharePoint's default client side rendering could be taking effect and rendering over your changes after you have applied them ? At a minimum it might make a difference if your CEWP is above or below the listview web part ? Also do you need to call jQuery(document).ready() ? eg. (I have not tested this...) <script type="text/javascript" ...


1

I have modified the function and split it into 3 functions. I have not tested this code, but based on my past similar experience this can be the solution. 1. Create a table structure with tr inside it. //Create a table structure with rows having id = version id of an item function createVersionTable() { var tr = []; for (var i = 0; i < ...


1

Try below. I have used the $.when(Deferred).done(whatever here); function YourFunctionName(){ var tblBody = ''; var Callback = function(){ for (var i = 0; i < xArr.length; i++) { tblBody += "<tr>"; var xDiv = $("<div>"); xDiv.load(xAppWebUrl +"/Lists/dlWerkinstructies/Forms/DispForm.aspx?ID=" + xItemId + ...


1

As far as I see, the value of the _ModerationStatus is stored as numbers, corresponding the values in the SPModerationStatusType enumeration. You can translate the numerical values by defining your own moderationStatusType array in JavaScript as shown below: var moderationStatusType = [ "Approved", "Denied", "Pending", "Draft", "Scheduled" ]; var ...


1

You can use ToolTipTitle and  ToolTipDescription of the Button element in custom action.


1

Yes this is possible. I have successfully used the the onvaluesetfrompicker function of a Date field, like so: $('#specificDateFieldID').get(0).onvaluesetfrompicker = DatePickerChanged; function DatePickerChanged() { // Do stuff } But this was in SharePoint 2013. It seems from this that it should also work in SharePoint 2010 with custom forms, but ...


1

The solution I would use instead of populating the options based on the selection would be to create two different fields in a list (meat options and vegetable options). With that you could throw in a simple script on a custom form to show the meat options when the meat radio button is selected and same thing for vegetables. This way all of your ...


1

This is happening because of Minimal Download Strategy, which is by default enabled on SP Online. To make it work, you should use SP.SOD.executeFunc https://msdn.microsoft.com/en-us/library/office/ff409592%28v=office.14%29.aspx This ensures that the specified file that contains the specified function is loaded and then runs the specified callback ...


1

If you have implemented a custom web part then why not set your drop-down value through your C#/VB.net code? I will give you an example of a C# code on how you can change the default value in a drop-down list on page load event. In below code "status" is your drop-down list name. protected void Page_Load(object sender, EventArgs e) { string ...


1

Try this: $(document).ready(function(){ if($("select[title='Status']").find("option:selected").val() == "Choose..") { $("select[title='Status']").val("InProgress"); } });


1

$(document).ready(function(){ if($("select[title='_title of column_'] option:selected").val() == "Choose.."){ $("select[title='_title of column_']").val("In progress..."); } }); not tested, but something like that should do it



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