Tuesday, July 2, 2013

Choti choti magar moti baatein (do's and don'ts) - SharePoint Tips

Hi Friends,

About Choti choti magar moti baatein(do's and don'ts). It’s a Hindi language catchphrase for caution about something, it’s got popular when Shaktimaan – An Indian Superhero started a series educating children about the right and wrong things. (In childhood we all enjoyed it, of course bunking from school  J )

In this brand new session we will discuss about SharePoint development do's and don'ts. It will improve the performance and usability of SharePoint applications.

We will also see SharePoint development tips, case studies, best practices and all about SharePoint world.

Everyone can do…
1)  Share a new topic
2) Start discussion
3) Suggest solutions
4) Nothing else……………


Amit Phule

Saturday, April 20, 2013

JQuery Selectors

JQuery is awesome, effective, powerful, rocking… I don’t have more word to say about JQuery.

In past I have posted some JQuery magic scripts, here I want to share some basic knowledge of JQuery selectors which will helps to target html tags.

jQuery offers a great engine for selecting html tags(elements) in the document which almost gives every filter option (tag name, attribute name, classes , properties etc.) for effective selection.

Here effective selection means, selection will not fail at any condition. Example: New html tags get added or in .Net server side controls id get change on each page load.


/* ########## Select HTML Tags ###########*/

// Get all tags by CSS class name
$(".ms-vb-user").css("display", "none");

// Get all div tags by CSS class name
$("div.ms-vb-user").css("display", "none");

// Get tag by id
var SelectedVal = $('#TDRightArea').text();

// Loop through all matching tags
$('a[href*=/_layouts/userdisp.aspx?ID=]').each(function () {
        var SelectedVal  = $(this).text();  
    });

//Get Parent Tag 
$('#TDRightArea').parent().html();


/* ########## Select and find in HTML Tags ###########*/

$('#TDRightArea').find('div.rightsubarea').each(function () { 
   $(this).css("color", "blue");
});


/* ########## Select .Net Controls ###########*/

// Get Radio Button List selected option
var SelectedVal = $('input[type=radio][id*=RBLLocation]:checked').val();

// Get TextBox entered text
var SelectedVal = $('input[type=text][id*=TxtLocation]').val();

// Get ListBox selected option
var SelectedVal = $("[id*='LBLocation'] option:selected").text();

// Get DropDown List selected option
var SelectedVal = $("[id*='DDLLocation'] option:selected").text();

// Get CheckBox List selected option
var SelectedVal = $('input[type=checkbox][id*=CBLLocation]:checked').next().text();

// Check CheckBox List option is checked, return true or false
var isChecked = $('input[type=checkbox][id*=CBLocation]').is(':checked');


/* ########## Select SharePoint Controls ###########*/

//Get PeopleEditor control value (SharePoint)
var SelectedVal = $("textarea[id*='PeopleEditorManager']").val();

More reference blogs:

http://api.jquery.com/category/selectors/
http://codylindley.com/jqueryselectors/
http://www.w3schools.com/jquery/jquery_ref_selectors.asp
http://www.w3schools.com/jquery/jquery_selectors.asp


ENJOY !!!

Sunday, February 17, 2013

Change Date Format of SharePoint Date Time Column


SharePoint 2010 provides a seamless, culture-specific experience that enables site owners to create sites in a specific language and configure the regional settings that are appropriate for those sites.

SharePoint Server 2010 uses the following types of regional settings: locale, time zone, sort order, calendar, and currency. You can specify the locale, sort order, time zone, and calendar settings on the Regional Settings page.

Change Date Format:
1) Go to "Site settings" from "Site Actions" Tab.
2) Under the "Site Administration" Section click on "Regional settings".
3) In "Locale" choice select desire option; example format DD/MM/YYYY you need to select "English (United Kingdom)".


Wednesday, January 2, 2013

Package the external DLL’s along with the SharePoint Solution (WSP)

Visual Studio 2010 by default does not include external DLL in the SharePoint Package (WSP). We need to add this DLL explicitly in the package.

1. Include external DLL in the SharePoint Project.

2. Include DLL using package manager.

3. Verify DLL is included in the WSP.
Enjoy !