Posts

SP People Picker Validation

pplpicker4.Controls.Clear(); ------>   Used to clear the  peoplepikker  control (it means that clearing the user in people  pikker )   validation message fire when user  cliks  in submit button   Change with  PeoplePicker  ID By Using  Inspactelement ......   <script type="text/ javascript " language=" javascript ">               function  CheckReportsTo (source, arguments) {               if (aspnetForm. ctl00_PlaceHolderMain_pplEHOD _downlevelTextBox.value == "")                     arguments.IsValid = false;               else               ...

Caml Querry Example Using AND and IN Operator

var strQry="";  strQry = '<Query><Where><And><And><Eq><FieldRef Name="ResourceName" /><Value Type="Text">' + resourceName + '</Value></Eq><And><Leq><FieldRef Name="EndDate" /><Value IncludeTimeValue="FALSE" Type="DateTime">' + lastdayval + '</Value></Leq><Geq><FieldRef Name="StartDate" /><Value IncludeTimeValue="FALSE" Type="DateTime">' + firstdayval + '</Value></Geq></And></And><In> <FieldRef Name="ProjectName" /><Values>'     $.each(proNameArry, function (i, proName) {         strQry += '<Value Type="text">' + proName + '</Value>'     });     strQry += '</Values></In></And></Where></Query>' Sample CAML Querry Using AND and...

Check a value Exist in Array in Jquerry

Check Value in Array / return true false var found = $.inArray(value, Array) > -1; Removing Duplicates and push into a new Array. var ResArray =["anil", "Kumar","anil"];  $.each($.unique(ResArray), function(i, el){                     uniqueNames.push(el);                 }); Out Put: uniqueNames=["Anil", "Kumar"]; Pick The Extra users After Comparing 2 Arrays: var PickedUsers=["1","2"]; var uniqueNames=["2"]; var extraUsers=[]; jQuery.grep(PickedUsers, function (el) {                     if (jQuery.inArray(el, uniqueNames) == -1)                         extraUsers.push(el);                 }); Out Put: extraUsers=["1"];

Convert First letter ToUpperCase using Jquerry

var  Name ="anilkumar .d" var Nameval = Name.toLowerCase().replace(/\b[a-z]/g, function (letter) {                         return letter.toUpperCase();                     }); Out Put: Anilkumar. D

Adjust Check Names CSS in Sharepoint People Picker

Adjust Check Names CSS in Sharepoint People Picker  $("[id$=_pplPickUser_OuterTable] tr").find("td:eq(2)").css("padding-top", "5px"); Adjust Hight & Width of People Picker $("[id$=_pplPickUser_OuterTable]").css("width", "180px"); $("[id$=_pplPickUser_upLevelDiv]").css("height", "20px");

Export To Excel Using Jquerry

function download(strData, strFileName, strMimeType) {     var D = document,         a = D.createElement("a");     strMimeType = strMimeType || "application/octet-stream";     if (navigator.msSaveBlob) { // IE10+         return navigator.msSaveBlob(new Blob([strData], { type: strMimeType }), strFileName);     } /* end if(navigator.msSaveBlob) */     if ('download' in a) { //html5 A[download]         if (window.URL) {             a.href = window.URL.createObjectURL(new Blob([strData]));         } else {             a.href = "data:" + strMimeType + "," + encodeURIComponent(strData);         }         a.setAttribute("download", strFileName);         a.innerHTML = "downloading...";         D.body.appendChil...

Create a JsonObject from a Collection in Jqerry

                     forEach(SPlistItem Item in litsItemCollection){                        var    resourceInfoJson = {};                         var    UserAllccationarry=[];                                               resourceInfoJson["Employee"] = Item.ResName;                         resourceInfoJson["ID"] = Item.lstItemID;                         UserAllccationarry.push(resourceInfoJson);                      }