Thursday, June 12, 2014

Adding/Removing items to/from radio button list in sharepoint


 we can add/Remove Item to/from radio button list.
1.put sharepoint control in the div
2.check required option value to hide
3.write bellow in document.ready function


$("#divCategory").find("input[type='radio']").each(function() {
             var res=$(this).closest('span').attr("title");
             if(res=='Other')
             {
               $('span.ms-RadioText[title="Other"]').css('display', 'none');                   
             }
          });

Wednesday, June 11, 2014

Adding/Removing items to/from dropdown box in sharepoint using jquery

write the bellow in document.ready function.
here numcat is dropdown name

Remove an option :
$(":input[title='numcat']").find("option[value='1']").remove(); 
Add an option
$(":input[title='numcat']").append('');
 

 

Tuesday, June 10, 2014

How to change subsite url point to it's site collection url ?

$(document).ready(function(){                

$(".ms-siteicon-a").attr("href", "/sites/AxaltaQuality/SitePages/AXALTADPCQualityVIEWS/FMDocuments.aspx");  

});

Thursday, June 5, 2014

Remove hyper link form lookup field in dataview webpart/Display form

 using substring we can remove the hyper link:

<xsl:value-of select="substring-before(substring-after(@PresentSupplier,'>'),'<')"  disable-output-escaping="yes" />

here PresentSupplier is a lookup column 

Remove hyper link from people picker fields

Written bellow code in document.ready function 

// Remove  People picker hyperlink


$('a[href*="userdisp.aspx?ID="]').each(function()

  var link = $(this);
  $(this).after("" + link.text() + "");
  $(this).remove();
});
   

Get Year from Date column in Calculated column in sharepoint

 calculated formula:

IF([DateComposed]="" , "No Due Date",""&YEAR([DateComposed]))   

(OR)

=IF(DateComposed="","",""&YEAR(DateComposed))    

here : DateComposed is Date column

Refrence:
http://techtrainingnotes.blogspot.in/2012/02/sharepoint-group-by-year-or-month-in.html