New answers tagged

1

Please try below CSS code. .ms-dialog #ctl00_PlaceHolderDialogBodySection_PlaceHolderDialogBodyMainSection_ctl13_tablerow1, .ms-dialog #ctl00_PlaceHolderDialogBodySection_PlaceHolderDialogBodyMainSection_ctl13_tablerow2, .ms-dialog #ctl00_PlaceHolderDialogBodySection_PlaceHolderDialogBodyMainSection_ctl13_tablerow3, .ms-dialog ...


1

There are couple of ways to achieve this Using anchor tag you can specify which section of the page it should scroll to Using JavaScript you can find the group element. The scroll to that element by handling the click event.


0

I tweaked a code I am using (embedded in a JSLink) here (function () { var statusFieldCtx = {}; statusFieldCtx.Templates = {}; statusFieldCtx.Templates.Fields = { "ReminderDate": { "View": ColorCodeDueDate } }; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(statusFieldCtx); })(); ...


1

Use a Chrome Browser and the Cisar Extension to make CSR development a breeze with Live Editing in the browser. If you want to develop less CSR code, take a peek at iCSR.GitHub.io You can check all available rows/fields in a displayed View by executing (in the F12 console) ctx.ListData.Row.forEach((row)=>{console.dir(row)}) And learn all about ...


2

Here are the steps you should execute Get the XML for webpart Load Limited Webpart Manager object Add web part. You can find details on https://msdn.microsoft.com/en-us/library/office/hh185010(v=office.14).aspx#sectionSection1 Add an existing WebPart Using the Sharepoint client object Model


0

There's an easier way: ... list = listCollection.getByTitle("yourListTitle"); var defaultView = list.get_defaultView(); var defaultViewFields = defaultView.get_viewFields(); defaultViewFields.add("Title"); defaultViewFields.add("Modified"); defaultViewFields.add("NewField"); defaultViewFields.add("Attachments"); defaultViewFields.add("Status"); ...


0

I have tried using this caml query, but it does not work. I guess it is the caml itself. There is no effect in the list view called "All Items". var viewContext = SP.ClientContext.get_current(); var web = viewContext.get_web(); var listCollection = web.get_lists(); list = listCollection.getByTitle("yourListTitle"); viewCollection = list.get_views(); ...


0

Here is the code to set the welcome page: var context = null; var web = null; var rootFolder = null; var welcomePage = 'SitePages/Home.aspx'; SetWelcomePage(); function onSuccess() { context = new SP.ClientContext.get_current(); web = context.get_web(); rootFolder = web.get_rootFolder(); context.load(web); context.load(rootFolder); ...


0

//Display items created by user id 1 var currentUserId = 1; var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/lists/getbytitle('" + listName + "')/items?$orderby=OfficeLocation,Department,FirstName&$filter=AuthorId eq " + currentUserId + "&" + "@target='" + SPHostUrl + "'"; $.ajax( { url: url, ...


0

I have used sticky headers jquery plugin to freeze the column header in the list/libraries. You may find the full article in the below link http://spoodoo.com/sticky-headers-in-sharepoint-2013/ Download the JavaScript file here http://spoodoo.com/download/javascripts/stickyheaders/stickyHeaders_3.1.0.js


0

@brishal The below script will help you,kindly add your list name in the script,add it to a CEWP and place it below the list and make it hidden: <style type="text/css"> #TTNheading { OVERFLOW: hidden; HEIGHT: 28px; } #TTNlist { HEIGHT: 400px; OVERFLOW-X: auto; OVERFLOW-Y: scroll !important; }</style><script ...


0

You can do it in one line of JavaScript without jQuery: document.getElementById("pageTitle").innerHTML = String.format("{0:D}",new Date()); outputs: Wednesday, 07 October 2015 (date of StackOverflow post linked below) String.format is provided by SharePoint For more Date notations see: Changing date format using javascript


0

Make sure you have configured JQuery libraries in your SharePoint instance. Second, the date is getting appended to an element with style s4-pagedescription.. Since it 2013 I believe this element doesn't exists. So you can add similar element to the page <div class='s4-pagedescription' /> If you don't want to use jQuery then change below ...


4

Have you tried moving your code into the jQuery.getScript() success callback? Like this: $.getScript(hostweburl + "/_layouts/15/SP.RequestExecutor.js", function() { var executor = new SP.RequestExecutor(appweburl); // rest of code... });


0

The person/group column allows you to select which information to pull from the profile. So if you wanted to display Name, Phone Number, and Title, you would add 3 person/group columns, then choose the corresponding "Show field" option. Then you just select the same person for all 3 fields and they will stay in sync from AD as long as your profile sync job ...


0

@Arsalan, Hyperlink appears fine if viewed in Allitems.aspx or any other created view. However, in Displayform or Modal View it shows the code. Sorry, earlier had quoted for visible in Display form but not in modal view.


0

Try placing your code in "content place holder main" in editform.aspx


-1

If you are referencing to the js file, just remove those lines from the js file, use them only when embedding in HTML or ASPX page. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type=text/javascript> Your function </script>


0

The best thing is to not try to alter default behavior of SharePoint. It will break the user experience (different functionality on same type of action). I would create a JavaScript function for this using the SharePoint JavaScript API or REST API. You can then add a "script editor" web part on the page with a "Create new document" button in html. The ...


3

Rather than using $(document).ready() try this: <script> _spBodyOnLoadFunctionNames.push("ButtonFunc"); function ButtonFunc() { $('.ms-qcb-leftzone').append('<li class="ms-qcb-item"><a href="http://www.google.com">ButtonName</a></li>'); }) <script> If this doesn't work check that the selector $('.ms-qcb-leftzone') ...


0

The trick I am using it to use JavaScript by uploading my app.js (or whatever you call it) to the master page gallery /_catalogs/masterpage and reference it in the JSLink property of the list... So, my point is that you can do all types of validation (attach fucntion to on click events and maybe track text changes to input fields,etc...) not just rendering


0

Are you on 2010 or 2013? Status is the internal fieldname of SharePoints default Task Status feld on 2013 So if you create a new Field Status it will be Status0 (or was it 1 ?) for the Internal Name


0

The easiest way to do it, is to add this CSS to a Script Editor: <style> li.ms-core-menu-item[text="TEXT(of the entry which should be hidden)"] { display: none !important; } </style>


0

Is that column is lookup and display type ? please check column name in list seetings as columnName:title. If so need to change the column reference


0

It seems there can be few causes as mentioned below. Use of invalid field name. You need to use the internal field name! Change the List View Lookup Threshold value of the web application. Default value is 8.


1

What you could do, is to override the function in Core.js on the current page instead. If its a library the actions are added in the AddDocLibMenuItems. And the View/Edit Properties are added from the AddShareNamespaceMenuItems function. So you could add this function to your page, just make sure its loaded after Core.js: function AddDocLibMenuItems(m, ...


1

Try putting following script in Script Editor webpart on the page. Hope this might help you out. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".ms-list-itemLink > a").each(function(){ ...


1

I currently worked with the same requirement, so here i am sharing my solution which i used to get the TermSet object. $(document).ready(function () { SP.SOD.executeOrDelayUntilScriptLoaded(LoadAllTerms, 'SP.Taxonomy.js'); }); //loads all existing navigation terms function LoadAllTerms() { SP.SOD.executeFunc('sp.js', 'SP.ClientContext', ...


0

I have used below function to get terms from the term set. You can inspire from it. First connect to SharePoint Taxonomy session, get hold hold of Default Term Store. function customGetTerm() { var termSetName = "Your Term Set Name", locale = 1033, clientContext = SP.ClientContext.get_current(), taxonomySession = ...


1

Please try below mentioned code. You will get the current logged in user's username & department using SPServices <script src="/Scripts/jquery-1.10.2.min.js" type="text/javascript"></script> <script src="/Scripts/jquery.SPServices-2014.02.min.js" type="text/javascript"></script> <script language="javascript" ...


0

There are two ways to add this functionality. You can use Custom Action if you don't want to conditionally add the menu, so the menu will appear always for all users, as seen here If you want to conditionally add the item, then you would use code similar to the one you posted. In this case, the 3rd parameter should point to a JavaScript function. See this ...


0

Sounds as if you want to connect a local ASP.NET App to your SharePoint Online (I am making a lot of assumptions in my answer based on this). If this is true, you would need to impersonate a SharePoint Online user in the application code by setting the network credentials to the username and password of the SharePoint Online user account then connect to the ...


0

I took the minified version of the mootools file and changed it in only 3 places, instead of many, like on the not minified version. Not an elegant solution, but I couldn't find a better way.


0

The issue was with ClientContext object. It was not loading properly. Initially error was : "invalid Request". On next day it started showing below error( :O ) "Object doesn't support property or method 'set_formDigestHandlingEnabled' " After googling this error, I found that SP.Runtime.js and SP.js files were not loaded in sequence. I had to load ...


1

What is Survey in SharePoint 2013? Survey a special kind of list that enables the owner to create questions, have multiple people to respond, and summarize the results. You can use surveys to ask people what they think about issues, how to improve your processes, and many other topics. You can collect the results by using several different types of ...


1

If you want to add new item in context menu within document library than please follow steps mentioned in below links. How to Create Context Menus on Pages Document Library in SharePoint 2013 If you want to remove the context menu displayed on the first step when you click on (...) than please use below mentioned code. SPList list = ...


0

I discuss how to get started with jQuery (including how to deploy and reference the library) in this conference session: JavaScript and jQuery for SharePoint Developers


0

You have to register different namespaces for both applications in you code. Please check below mentioned links for the reference. What are the Type.registerNamespace advantages over standard JavaScript methods? CSR + MDS, where are my globals going?? (and I want them back!)


1

Just resolved my issue. I referred to this question's answer and added .attr('onclick', '') This clears the onclick attribute in the html. So my code now looks like this: $(document).ready(function(){ $("table#idAttachmentsTable a").attr('onclick', '').click(function (event) { event.preventDefault(); var ...


3

You can put <script type="text/javascript" src="/_layouts/Scripts/jquery-min.js"></script> in master page to access this javascript globally in all pages. Or you can put that script tag in your custom webpart / content editor webpart / script editor webpart to access that script only for that webpart only.


1

You have a bunch of typos any decent JavaScript editor would have warned you about (and saved you loads of time) Go checkout VSCode (Visual Studio Code) - Microsoft - Free Brackets - Adobe - Free and use JSHint.com - (available as plugin in both editors), before you ask a question here and have to wait if someone is nice enough to answer I pasted your ...


1

Is this your actual code that you are using? I tried formatting this code and it looks like this code is invalid Repeated Quotes Prematurely exiting change callback here if($("select[title='BE Info 1']").val() == "B4 Choices"") // <- repeated quotes { $('nobr:contains("B1 Choices")').closest('tr').hide(); ...


1

One way you could do this is to open up SharePoint Designer and create an item workflow in passenger list(triggered on Create or Modified) for the passenger list. Create a parameter in the workflow for each bus type and for add a value to the correct parameter based on some if statements. Once you have those parameters you could loop through the items on ...


0

You can do something like that: <script> var targetListItem; var listName="js"; var itemId=1; ExecuteOrDelayUntilScriptLoaded(GetListItem, "sp.js"); function GetListItem(listName,itemId) { var clientContext = new SP.ClientContext(); var targetList = clientContext.get_web().get_lists().getByTitle(listName); ...


1

You need to start the iteration on listCount-1 because the array is zero-based. Also, after the loop has finished you need to do a new executeQueryAsync to actually save / send the changes to the server. So complete example: var context = SP.ClientContext.get_current(); var web = context.get_web(); var oList; var listitems; function ...


0

add this in your custom css div[id^=MSOZoneCell_] { position:relative; } #ms-dnd-dropbox{ left:0 !important; top: 0 !important; }


0

You would use CAML inside your JavaScript, here's how to use it: http://blog.bonzai-intranet.com/analysthq/2014/10/adding-an-xsltlistviewwebpart-with-a-custom-view-using-javascript/


2

Yes, inside the .aspx files for the layout, use the Security Trimmed Control: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.webcontrols.spsecuritytrimmedcontrol.aspx Specifically you'd probably do something like this: <SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" ...


0

That seems like a lot of work when you can just go into SP Designer and edit the view and change the column name. Very simple to do...


0

yes add Id to column names it worked: Columns : Course_x0020_Id and Participant var courseId = GetQueryStringValues('ID'); var currentUser = GetCurrentUser(); var todaysDate = GetTodaysDate(); var itemToCreate = {'Category' : 'Register', 'Course_x0020_IdId' : courseId, 'ParticipantId' : currentUser, 'RegistrationDate' : todaysDate}; ...



Top 50 recent answers are included