Created
February 27, 2015 14:11
-
-
Save ITUnity/d1b08fdbb4217e2980dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// Intialize the variables for overrides objects | |
var overrideCtx = {}; | |
overrideCtx.Templates = {}; | |
// Override field data | |
overrideCtx.Templates.Fields = { | |
// PercentComplate = internal name of the % Complete | |
// View = you want to change the field rendering of a view | |
// <dev ... = here we define what the output of the field will be. | |
'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>' } | |
}; | |
// Register the override of the field | |
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); | |
})(); | |
(function () { | |
"use strict"; | |
if (typeof (_spBodyOnLoadCalled) === 'undefined' || _spBodyOnLoadCalled) { | |
load(); | |
} | |
else { | |
_spBodyOnLoadFunctions.push(load); | |
} | |
function load () { | |
CDNManager.getScript(['jquery-1.11.2.min.js','bootstrap.min.js'], ready); | |
}; | |
function ready () { | |
jQuery('[data-toggle="tooltip"]').tooltip(); | |
}; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment