Search This Blog

Total Pageviews

Wednesday, July 26, 2017

SharePoint: A Complete Guide to Getting and Setting Fields using C#

https://social.technet.microsoft.com/wiki/contents/articles/21801.sharepoint-a-complete-guide-to-getting-and-setting-fields-using-c.aspx

Wednesday, June 14, 2017

Filter and Paging For SharePoint Library

Create Calculated Column "FN" Formula =UPPER(LEFT([Title]))

Edit  all items view page -> add the following script in Script editor.

<script type="text/javascript">
    function qs(paramName) {
        var args = document.location.search.substring(1).split("&");
        for (j = 0; j < args.length; j++) {
            nameValues = args[j].split("=");
            if (nameValues[0] == paramName) return nameValues[1];
        }
        return null;
    }
    var filterField = "FN";
    var filterValuesDelimiter = " - ";
    var filterValues = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
    var selectedValueStyle = "font-weight: bold;";
    var filterDivStyle = " font-size: 15px;";
    var filterLinks = new Array();
    for (var i = 0; i < filterValues.length; i++) {
        filterLinks.push('<a ' + (qs("FilterValue1") == filterValues[i] ? 'style="' + selectedValueStyle + ' ' : '') + 'href="' + document.location.pathname + '?FilterField1=' +
            filterField + '&FilterValue1=' + filterValues[i] + '">' + filterValues[i] + '</a>');
    }
    document.write('<div class="textfilter" style="' + filterDivStyle + '">' + filterLinks.join(filterValuesDelimiter) + '</div>');
</script>
<style>
    .ms-bottompaging {
        background-color: #216288;
        width: 100%;
        color: white;
    }

 
    .textfilter {
        text-align: center;
        background-color: #216288;
        color: white;
        margin-top: -20px;
        padding: 3px 3px 3px 3px;
    }

    .textfilter a:visited {
        color: white;
    }

    .textfilter a:selected {
        color: white;
    }

    .textfilter a:link {
        color: white;
    }

    .textfilter a:hover {
        color: yellow;
    }

    .textfilter a,
    .ms-link:visited {
        color: white;
    }

   
</style>

Wednesday, June 7, 2017

SharePoint 2013 Tab Pages

Tab-Pages :
http://www.ashokraja.me/post/Easy-method-to-convert-a-SharePoint-2013-Content-Editor-WebPart-into-Tab-Pages.aspx

http://www.ashokraja.me/post/Tab-Pages-WebPart-in-SharePoint-2013-based-on-jQuery-Easy-Tabs-without-combining-multiple-web-parts.aspx

CSS Effects & Animation



Gradient Effect using CSS

https://testdrive-archive.azurewebsites.net/Graphics/CSSGradientBackgroundMaker/Default.html

Image Roll Over Effect
http://aceinfowayindia.com/blog/ace-tuts/css-rollover.html


CSS Animations
http://www.the-art-of-web.com/css/css-animation/


CSS: border-radius
http://www.the-art-of-web.com/css/border-radius/

Monday, May 22, 2017

how to set any SP.Field Value with JSOM (Javascript) Sharepoint 2013

function createListItem() {  
   var clientContext = new SP.ClientContext(_spPageContextInfo.siteAbsoluteUrl);  
   var oList = clientContext.get_web().get_lists().getByTitle('TestList');  
   var itemCreateInfo = new SP.ListItemCreationInformation();  
   this.oListItem = oList.addItem(itemCreateInfo);
  
   //Single line of text  
   oListItem.set_item('Title', 'My New Item!'); 
 
   //Single Choice  
   oListItem.set_item('PetkaChoiceDrop', 'Enter Choice #1');  

   //Multi Choice  
   var petkaChoiceMultiArray = new Array("Enter Choice #1","Enter Choice #2");    
   oListItem.set_item('PetkaChoiceMulti', petkaChoiceMultiArray);  

   //Single Lookup  
   var PetkaLookupSingle = new SP.FieldLookupValue();  
   PetkaLookupSingle.set_lookupId(2);  
   oListItem.set_item('PetkaLookup', PetkaLookupSingle);  

   //Multi Lookup  
   var lookupsIds = [1,2];  
   var lookups = [];  
   for (var ii in lookupsIds) {  
      var lookupValue = new SP.FieldLookupValue();  
      lookupValue.set_lookupId(lookupsIds[ii]);  
      lookups.push(lookupValue);  
   }  
   oListItem.set_item('PetkaLookupMulti', lookups);
  
   //Yes=1 / No=0  
   oListItem.set_item('PetkaYesNo', 1);  

   // Single Person  
   var singleUser = SP.FieldUserValue.fromUser('Peter Dotsenko');  
   oListItem.set_item('PetkaPersonSingle', singleUser);  
   
   //Multi Person  
   var petkaUserMultiArray = new Array("peterd@domain.com","Peter Dotsenko","domain\\peterd");  
   var lookups = [];  
   for (var ii in petkaUserMultiArray) {  
      var lookupValue = SP.FieldUserValue.fromUser(petkaUserMultiArray[ii]);  
      lookups.push(lookupValue);  
   }  
   oListItem.set_item('PetkaPersonMulti', lookups); 
 
   //Managed Multi  
   var field = oList.get_fields().getByInternalNameOrTitle("PetkaManagedMulti");  
   var taxField = clientContext.castTo(field, SP.Taxonomy.TaxonomyField);  
   var terms = new SP.Taxonomy.TaxonomyFieldValueCollection(clientContext,getMultiTax(),taxField);  
   taxField.setFieldValueByValueCollection(oListItem, terms);  

   //Managed Single  
   var field = oList.get_fields().getByInternalNameOrTitle("PetkaManagedSingle");  
   var taxField = clientContext.castTo(field, SP.Taxonomy.TaxonomyField);  
   var taxonomySingle = new SP.Taxonomy.TaxonomyFieldValue();  
   taxonomySingle.set_label("Mamo");  
   taxonomySingle.set_termGuid("10d05b55-6ae5-413b-9fe6-ff11b9b5767c");  
   taxonomySingle.set_wssId(-1);  
   taxField.setFieldValueByValue(oListItem, taxonomySingle);
  
   //Hyperlink or Picture  
   var hyperLink = new SP.FieldUrlValue();  
   hyperLink.set_url("http://cnn.com");  
   hyperLink.set_description("CNN");  
   oListItem.set_item('PetkaHyperLink', hyperLink);
  
   //Currency  
   oListItem.set_item('PetkaCurrency', '100');
  
   //DateTime  
   oListItem.set_item('PetkaDateTime', '3/14/2014'); 
 
   //MultiLine text  
   oListItem.set_item('PetkaMultiText', '<p><strong>Hello!</strong></p>');
  
   oListItem.update();  
   clientContext.load(oListItem);  
   clientContext.executeQueryAsync(  
     Function.createDelegate(this, this.onQuerySucceeded),   
     Function.createDelegate(this, this.onQueryFailed)  
   );  
 }

function getMultiTax(){  
      var terms = new Array();  
      terms.push("-1;#Mamo|10d05b55-6ae5-413b-9fe6-ff11b9b5767c");  
      terms.push("-1;#Popo|178888b0-7942-45bb-b3f1-2f38d476e3db");  
      return terms.join(";#");  
}

function onQuerySucceeded() {
    SP.UI.Notify.addNotification('Item created: ' + oListItem.get_id());
}

function onQueryFailed(sender, args) {
    console.log('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}