Showing posts with label Jquery. Show all posts
Showing posts with label Jquery. Show all posts

Wednesday, March 17, 2021

17 Mar

How to check whether the current user has edit permission for a particular list using JSOM in SharePoint 2013

 we first need to get the login name of user and pass it to the get_effectiveBasePermissions method.To ensure that user has edit permission, we will check the SP.PermissionKind.editListItems enum.SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {    getCurrentUserPermission();});function getCurrentUserPermission(){ ...

Friday, July 24, 2020

24 Jul

JavaScript : How to Convert UTC Date Time to local/EST Hours using JavaScript?

In this below script, Convert UTC Date Time to local/EST Hours In this article , we will use default java-script action Type 1: var localTime = new Date(); var localKolkata = moment.tz(localTime, "Asia/Kolkata").format("hh:mm:ss"); Javascript script provide date and time format. Type 2: function getLocalTime(i)...

Monday, June 20, 2016

20 Jun

How to get Auto populate dropdown in SharePoint List using SPServices?

In this below script, Auto populate dropdown in SharePoint List using SPServices <input type="text" id="txtsearch" onkeyup="binddetails()"> Code: function binddetails() { availableTags = [];   $().SPServices({             operation: "GetListItems",        ...

Thursday, May 12, 2016

12 May

How to get all the td values of a Table in a JavaScript function?

In this below script, get all the td values of a Table in a JavaScript Script: $("#tblemp tbody tr").each(function() {             alert($(this).find("td:last-child").html());     }); HTML: <table id="tblemp" class="display" cellspacing="0" width="100%">    ...

Tuesday, April 26, 2016

26 Apr

Item Adding / Item Added Event Receiver for Document Library

In this below script, Item Adding / Item Added Event Receiver Ways to retrieve data are: Properties.ListItem[«FieldName »] Properties.AfterProperties[«FieldName »] Properties.BeforeProperties[«FieldName »] we must add the synchronization parameter  to our xml definition. <Receiver> <Name>EventReceiver1ItemAdded</Name> <Type>ItemAdded</Type> <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly> <Class>TutoTaxonomy.EventReceiver1.EventReceiver1</Class> <SequenceNumber>10000</SequenceNumber> <Synchronization>Synchronous</Synchronization> </Receiver> In...

Saturday, April 9, 2016

09 Apr

Print css using Window.print() using pdf print

In this below script, Print css using Window.print <style type="text/css" media="print"> @page { size: auto; /* auto is the initial value */ margin: 0; /* this affects the margin in the printer settings */ } </style> @page :left { margin-left: 4cm; margin-right: 3cm; } @page :right { ...
09 Apr

Freeze header in SharePoint List 2013

In this below script, Freeze header in SharePoint List 2013 The stickyHeaders widget as part of the Sharepoint List . _spBodyOnLoadFunctionNames.push("stickyHeaders"); function stickyHeaders() {//-----------------------------------------------------------------------------------------------------------------------------------------------...

Thursday, March 31, 2016

31 Mar

How to Turn on Line Numbers In Visual Studio

In this below script, Turn on Line Numbers In Visual Studio Line numbers are not on by default.    Tools -> Options -> Text Editor -> All Languages -> General -> Display and check Line numbers: ...

Wednesday, March 30, 2016

30 Mar

Configuring Auditing in SharePoint 2010

In this below script, Configuring Auditing in SharePoint 2010 Go to site Settings select Site collection Administration Choose Audit log Reports Delete Deletion Please the save location  I'll save this report to the Shared Documents Library, however in production this is where I create a document library with...

Tuesday, March 29, 2016

29 Mar

How to get current master page and change it on the Site using javascript

 GET request /_api/Web?$select=CustomMasterUrl,MasterUrl function MastePageChange() {     var clientcontext;     var cweb;     var customMasterURL = '/_catalogs/masterpage/NewMasterPage.master';     clientcontext = new SP.ClientContext.get_current();     cweb =...
29 Mar

How to set SharePoint list view 'Item Limit' with the option programmatically

Limit the total number of items returned to the specified amount ClientContext clientContext = new ClientContext("http://hercules");           clientContext.Credentials = new NetworkCredential("Peakfinder", "password@1");           string listName = "Employess", viewName...
29 Mar

How to change SharePoint list field color using jquery code base on value?

In this below script, hange SharePoint list field color using jquery code  $("table.ms-listviewtable > tbody > tr > td:nth-child(columnNumber) > div").filter(function() {         ( parseInt( $(this).text() ) > 59 ) ? $(this).css("background-color", "#00FF66") : null    ...
29 Mar

Calculating date value based on a column value Using SharePoint Workflow

In this below script, oCalculating date value based on a column value SP =IF(A<1/3/2016,A+100,A+50) Set the column to return date. ...
29 Mar

How to open a calendar item in a modal dialog?

In this below script, open a calendar item in a modal dialog function openDialog(pageUrl) {   var options = {       title : "calender",       width : 500,       height : 400,       url : pageUrl   };   SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog',...

Friday, March 25, 2016

25 Mar

Print Angular JS

http://jsfiddle.net/BlinkSun/tcVhN/235/ a factory that you can call and a directive, two way: by htmls from variable scope or by extern template, if the template have a css linked in, it must print de style too...

Thursday, March 24, 2016

24 Mar

Error in "Pause for" Action - Nintex Workflows

In this below script, "Pause for" Action - Nintex Workflow ·        Email triggered says Workflow Terminated unexpectedly for item. ·        Error message logged was “Error POC 1” failed to run. ·       ...

Tuesday, March 22, 2016

22 Mar

@media print remove url href values when printing in Chrome

In this below script, remove url href values when printing in Chrome using javascript your printed webpages you will need to use your CSS styles to override it.  Customize the print CSS, and finding that it prints links out with the href value as well as the link. }@media print {   a[href]:after...
22 Mar

STSNavigate in SharePoint

In this below script,STSNavigate in SharePoint In this article menu item uses createNewDocumentWithRedirect function in core.js file <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">        <SharePoint:RssLink runat="server"/>    ...
22 Mar

How to add custom context menu list in SharePoint 2013?

In this below script,add custom context menu list in javascript In this article ,We have create custom Context menu in SharePoint custom list , for single list(i.e. List Library) I have created a custom action for the content type.   1.Open SharePoint Designer. 2. Open SharePoint site 3. Go to that specific...
22 Mar

How to Print css in SharePoint 2013

In this below script,Print css in javascript I got is adding media="print" property to the CSS references. /* This CSS removes the header, navigation and other action elements from the print preview  */ 1.  <style>      @media print{      #suiteBar{display:none;}  ...