Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. (function () {
  2. // Intialize the variables for overrides objects
  3. var overrideCtx = {};
  4. overrideCtx.Templates = {};
  5.  
  6. // Override field data
  7. overrideCtx.Templates.Fields = {
  8. // PercentComplate = internal name of the % Complete
  9. // View = you want to change the field rendering of a view
  10. // <dev ... = here we define what the output of the field will be.
  11. 'PercentComplete': { 'View': '<div class="progress" data-toggle="tooltip" data-placement="right" title="<#=ctx.CurrentItem.PercentComplete.replace(" %", "")#>%"><div class="progress-bar" role="progressbar" aria-valuenow="<#=ctx.CurrentItem.PercentComplete.replace(" %", "")#>" aria-valuemin="0" aria-valuemax="100" style="width: <#=ctx.CurrentItem.PercentComplete.replace(" %", "")#>%;"></div></div>' }
  12. };
  13.  
  14. // Register the override of the field
  15. SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
  16. })();
  17.  
  18.  
  19.  
  20. (function () {
  21. "use strict";
  22.  
  23. if (typeof (_spBodyOnLoadCalled) === 'undefined' || _spBodyOnLoadCalled) {
  24. load();
  25. }
  26. else {
  27. _spBodyOnLoadFunctions.push(load);
  28. }
  29.  
  30. function load () {
  31. CDNManager.getScript(['jquery-1.11.2.min.js','bootstrap.min.js'], ready);
  32. };
  33.  
  34. function ready () {
  35. jQuery('[data-toggle="tooltip"]').tooltip();
  36. };
  37.  
  38.  
  39. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement