Problem
I've two custom lists with ListTemplateType = 100
. When I insert both into a page, the last rewrite the first.
I tryed add BaseViewID
with diferent ID, like this question. But anything works with this property and is showed with default Sharepoint template.
Template 1 app1-jslink.js
;(function(){
overrideCtx.Templates.Header = "<div id='gallery-cardapio'>"+
"<div class='gallery-cardapio'>"+
"<ul class='thumbs'>";
overrideCtx.Templates.Footer = CustomFooter;
// overrideCtx.BaseViewID = 1000; // Do not works
overrideCtx.ListTemplateType = 100;
overrideCtx.Templates.Item = CustomItem;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
function CustomItem(ctx){...}
function CustomFooter(ctx){...}
})();
Template 2 app2-jslink.js
;(function(){
overrideCtx.Templates.Header = "<div id='gallery-niver'>"+
"<div class='gallery-container'>"+
"<ul class='thumbs'>";
overrideCtx.Templates.Footer = CustomFooter;
// overrideCtx.BaseViewID = 900; // Do not works
overrideCtx.ListTemplateType = 100;
overrideCtx.Templates.Item = CustomItem;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
function CustomItem(ctx){...}
function CustomFooter(ctx){...}
})();
Tests
If I put BaseViewId
in just one, both templates are rendered with override that does not have BaseViewId
property.
If I put BaseViewId
in both, they are render with default Sharepoint template.
If I don't put BaseViewId
, both are render with last override.
How fix it? How to use 2 diferent lists of type custom (100) in same page?
Sorry, my english is not very good, and I've taken a bit help from Google Translate.