Showing posts with label Jquery. Show all posts
Showing posts with label Jquery. Show all posts

Tuesday, March 29, 2016

How to set SharePoint list view 'Item Limit' with the option programmatically

Limit the total number of items returned to the specified amount



ClientContext clientContext = new ClientContext("http://hercules");
          clientContext.Credentials = new NetworkCredential("Peakfinder", "password@1");
          string listName = "Employess", viewName = "All Items";          
          bool paged = true;      
          List list = clientContext.Web.Lists.GetByTitle(listName);
          View view = list.Views.GetByTitle(viewName);
          view.Paged = paged;
          view.Update();
          clientContext.ExecuteQuery();

How to change SharePoint list field color using jquery code base on value?

In this below script, hange SharePoint list field color using jquery code

change SharePoint list field color
 $("table.ms-listviewtable > tbody > tr > td:nth-child(columnNumber) > div").filter(function() {
        ( parseInt( $(this).text() ) > 59 ) ? $(this).css("background-color", "#00FF66") : null  
    });

Calculating date value based on a column value Using SharePoint Workflow

In this below script, oCalculating date value based on a column value SP

Calculating date value based on a column value
=IF(A<1/3/2016,A+100,A+50)
Set the column to return date.


How to open a calendar item in a modal dialog?

In this below script, open a calendar item in a modal dialog

open a calendar item in a modal dialog In SharePoint
function openDialog(pageUrl) {
  var options = {
      title : "calender",
      width : 500,
      height : 400,
      url : pageUrl
  };

  SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}

$('.ms-acal-month').ready(function () {
   setTimeout(function() {
       $('a[href*="DispForm.aspx"]').each(function() {
           $(this).attr('onclick', 'openDialog("' +  $(this).attr('href') + '")');
           $(this).attr('href','javascript:void(0)');
       });
   }, 1000);
});

Friday, March 25, 2016

Print Angular JS

http://jsfiddle.net/BlinkSun/tcVhN/235/

a factory that you can call and a directive, two way: by htmls from variable scope or by extern template, if the template have a css linked in, it must print de style too !