Friday, June 24, 2016

Sorting on JSON

Hi , JSON is the handy object for JS. To sort in JSN var nItems = { nid: item.ParentLink, nName: item.Title, cid: item.Id, URL: item.URL, DO: item.DisplyOrder } var deskItem = $.trim(item.Title).toUpperCase(); ParentNodes.push(nItems); ParentNodes.sort(function(a, b){ return a.DO - b.DO; });

Tuesday, May 31, 2016

Align horizontal radio buttons for choice field in sharepoint

Hi , We all are struggling to make sharepoint choice fields as horizontal alignment. After digging the code below is the solution.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

function HorizontalAlignChoices() { var objSpans=$(".ms-RadioText"); objSpans.each(function(){ $(this).closest("tr").css({"float":"left"}); }); } $(document).ready(function() {

alignOptions("choiceAlign");
alignOptions("testAlign");

});
</script>

 




Monday, November 30, 2015

Disabled drag and drop options from document library in SharePoint 2013

<style type="text/css">
/*-- Hide Drag & Drop --*/
caption.ms-dragDropAttract { caption-side: bottom; display: none !important; }
</style>

<script type="text/javascript">
/*-- Stop Drag & Drop --*/
ExecuteOrDelayUntilScriptLoaded(function () { g_uploadType = DragDropMode.NOTSUPPORTED; SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED; SPDragDropManager.DargDropMode.style.display = "none"; }, "DragDrop.js");
</script>

Monday, March 23, 2015

Change Tool bar postions and report parameters in SSRS

Hi, We are struggling while rendering SSRS reports like to change the alignment of the tool bar and passing the report parameters in sharepoint.
We can render the report toolbar on bottom of the report as below.
http://servername/sites/sitename/_vti_bin/reportserver?http://servername/sites/sitename/Lists/Report/PICReport.rdl&rv:docktoolbar=Bottom
Report parameters.
http://servername/sites/sitename/_vti_bin/reportserver?http://servername/sites/sitename/Lists/Report/PICReport.rdl&Report_PIC=filtervalue&rv:ParamMode=Hidden

Monday, November 10, 2014

Multi level of Cascading dropdown in OOB using SPService

Hi,
We are facing problem for cascade dropdown in multiple level using OOB feature. I have one requirement where i need to implement
cascade dropdown in my project. So i have implemented as below.

<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.01/jquery.SPServices.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){
$().SPServices.SPCascadeDropdowns({
relationshipList: "LocationMaster",
relationshipListParentColumn: "Country",
relationshipListChildColumn: "Title",
parentColumn: "Country",
childColumn: "Location",
debug:true
});
$().SPServices.SPCascadeDropdowns({
relationshipList: "StorageMaster",
relationshipListParentColumn: "Location",
relationshipListChildColumn: "Title",
parentColumn: "Location",
childColumn: "Storage",
debug:true
});
})
</script>

Wednesday, November 5, 2014

Add Multiline Text with Enhance Rich option in Clintobject Model

Create Multiline Text

Field styleField = list.Fields.AddFieldAsXml("", true, AddFieldOptions.DefaultValue);
FieldMultiLineText fieldMultiLineText = context.CastTo(styleField);
fieldMultiLineText.RichText = true;
fieldMultiLineText.AllowHyperlink = true;
fieldMultiLineText.UpdateAndPushChanges(true);
list.Update();
context.ExecuteQuery();


Create Multiline Text with ich text option
Field styleField = list.Fields.AddFieldAsXml("", true, AddFieldOptions.DefaultValue);
FieldMultiLineText fieldMultiLineText = context.CastTo(styleField);
fieldMultiLineText.RichText = true;
fieldMultiLineText.AllowHyperlink = true;
fieldMultiLineText.UpdateAndPushChanges(true);
list.Update();
context.ExecuteQuery();


created Enhanced rich text column and use the SchemaXML to generate the new field:

Field rtfField = list.Fields.AddFieldAsXml("" , true, AddFieldOptions.DefaultValue);
rtfField.UpdateAndPushChanges(true);list.Update();
context.ExecuteQuery();


RestrictedMode=\"TRUE\" RichText=\"TRUE\" RichTextMode=\"FullHtml\"

Wednesday, September 3, 2014

Get Site URL in Javascript in sharepoint

Get site and sitecollection url in javascript :
var siteUrl = _spPageContextInfo.webServerRelativeUrl;
var siteCollectionUrl = _spPageContextInfo.siteAbsoluteUrl;