我使用JSLink为SharePoint 2013列表中的行着色
ExecuteOrDelayUntilBodyLoaded(function () {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function () {
RegisterModuleInit(_spPageContextInfo.siteServerRelativeUrl + "/SiteAssets/jsLink.js", Highlight);
Highlight();
}
});
});
function Highlight() {
var HighlightFieldCtx = {};
HighlightFieldCtx.Templates = {};
HighlightFieldCtx.Templates.Fields = {};
HighlightFieldCtx.OnPostRender = postRenderHandler;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(HighlightFieldCtx);
}
function postRenderHandler(ctx)
{
var rows = ctx.ListData.Row;
for (var i=0;i<rows.length;i++)
{
// do stuff
row.classList.add("Color");
}
}
我需要添加 SP.SOD.executeFunc()来激活 _spPageContextInfo 。但是,当我添加SP.SOD.executeFunc()时,函数postRenderHandler未与
答案 0 :(得分:0)
尝试一下:
CREATE FUNCTION returnone(date)
RETURNS integer
LANGUAGE plpgsql AS
$func$
BEGIN
RETURN 1;
END
$func$;