SharePoint Saturday Belgium slides

I have to say this SharePoint Saturday was awesome! Thanks to a line-up of world-class speakers, excellent sponsors and a great audience.

Here are my slides and code.

Demo 1

    // hide status field
    $('nobr:contains("Status")').closest('tr').hide();

    // set Cost to readonly
    $(":input[title='cost']").attr('readonly',true);

  //hide the Ferrari option
  var dropdown = $(":input[title='Car']");
  dropdown.find("option[value='Ferrari']").remove();

Demo 2


    // set title value
    $(":input[title='Title']").val("request");

   //get destination from url
    $(":input[title='Destination']").val(getUrlVars()["Destination"]);

function getUrlVars(){
   var vars = [], hash;
   var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
   for(var i = 0; i < hashes.length; i++){
     hash = hashes[i].split('=');
     vars.push(hash[0]);
     vars[hash[0]] = hash[1];
   }
   return vars;
}

// the keyup event
$(":input[title='Distance']").keyup(function(){
    $(":input[title='cost']").val($(":input[title='Distance']").val());
});

Demo 3

function PreSaveAction() {
   //destination has to be filled in
   if ($(":input[title='Destination']").val() == ""){
      alert("Fill in a destination!");
      return false
   }
   return true;
};

Demo 4: Plugins

<script src="/SiteAssets/jquery.SPServices-0.7.1a.js" type="text/javascript"></script>
<script src="/SiteAssets/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script>
   //the jQuery UI datepicker
   $(":input[title='Day']").datepicker();

   // get current user via SPServices
   $('div.ms-inputuserfield').text($().SPServices.SPGetCurrentUser({fieldName: "Name"}));

Demo 5: Translation

if(_spPageContextInfo.currentLanguage == "1043"){
  $('nobr:contains("From")').text("Van");
  $('nobr:contains("Day")').text("Dag");
  $('nobr:contains("Driver")').text("Bestuurder");
  $('nobr:contains("cost")').text("Kostprijs");
  $('nobr:contains("Request reason")').text("Reden aanvraag");
  $('nobr:contains("Destination")').text("Bestemming");
};

About: Marijn

Marijn Somers (MVP) has over 12 years experience in the SharePoint world, starting out with SP2007. Over the years the focus has grown to Office 365, with a focus on collaboration and document management. He is a business consultant at Balestra and Principal Content Provider for "Mijn 365 Coach" that offers dutch employee video training. His main work tracks are around user adoption, training and coaching and governance. He is also not afraid to dig deeper in the technicalities with PowerShell, adaptive cards or custom formatting in lists and libraries. You can listen to him on the biweekly "Office 365 Distilled" podcast.

%d bloggers like this: