Monday, February 18, 2013

Learning JavaScript Design Patterns

Hi All,

Excellent article on Learning JavaScript Design Patterns.

Thanks Addy Osmani for this wonderful article.

Thanks,
Sachin Katkar.

Tuesday, February 5, 2013

Hide fields from SharePoint NewForm, DispForm and EditForm pages


Hi All,

Please find below Jquery script to hide the fields from NewForm.aspx, DispForm.aspx and EditForm.aspx page of SharePoint list

Hide fields from EditForm and NewForm


<pre class="brush: js">

$(document).ready(function() { 
$('nobr:contains("Recurrence")').closest('tr').hide(); 
$('nobr:contains("Location")').closest('tr').hide();
}); 


</pre>


Hide Fields from DispForm page

<pre class="brush: js">


$(document).ready(function() {

// Method #1: Access by FieldName – All fields have unique FieldNames
$('td.ms-formlabel:contains("Location")').parent().hide();

// Method #2:  Access by ID – NOTE: Not all fields have unique IDs
$('tr:has(td[id=SPFieldRecurrence])').not('tr:has(tr)').hide();
});

</pre>


Please refer to the link for more detail information.

Thanks,

Sachin K.

Wednesday, January 16, 2013

Clear SharePoint Designer Cache

Hi All,

Sometimes SharePoint Designer shows files checked out even though they ware not.



This is because designer is refering to local web cache.

 
Clear all the files from following location to resolve this issue.


- %APPDATA%\Microsoft\Web Server Extensions\Cache



- %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache


Reference

Thanks,

Sachin K.

Thursday, January 10, 2013

Using Javascript to get all choice values from SharePoint Choice column

Hi all,

Get List of all choice option from SharePoint Choice field with help of Javascript Client Object model




var context = new SP.ClientContext.get_current();

var web = context.get_web();

context.load();

var studList = web.get_lists().getByTitle("students");

var studbatches = context.castTo(studList.get_fields().getByInternalNameOrTitle("batches"), SP.FieldChoice);



context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod),

Function.createDelegate(this, this.onFailureMethod));



function onSuccessMethod(sender, args) {

var choices = studbatches.get_choices();

alert("Choices: (" + choices.length + ") - " + choices.join(", "));

}



function onFailureMethod(sender, args) {

alert("Error...!");

  } 


  Thanks,

 Sachin K. 


 Reference

Sunday, December 23, 2012

Your client does not support opening this list with Windows Explorer

Hi All,


If you ever get the this error "Your client does not support opening this list with Windows Explorer."





When opening SharePoint document library in explorer view that means your missing Desktop Experiance Feature on your server.



Please find below link to enable the Desktop Experiane feature.



Thanks,

Sachin K.