下面的代码是我绑定的dataTable。我无法弄清楚为什么它只显示顶级节点。
var currentLayer;
var layers = [];
// Create your layers and push them to the layers array.
window.addEventListener("keypress", function(e) {
var pressedKey = Number(e.key);
// If button pressed is not a number, return.
if (isNaN(pressedKey)) return;
// If the pressed number is greater than the length of layers, return.
if (pressedKey - 1 >= layers.length) return;
// If currentLayer is set, remove it from the map.
if (currentLayer) map.removeLayer(currentLayer);
currentLayer = layers[pressedKey - 1];
map.addLayer(currentLayer);
});
- EDIT-- 如果我将它添加到标记中,我可以看到2个节点。但它切换到垂直,不显示其他节点。
BreadCrumbSiteMap.DataSource = siteMapNavigationLocation;
BreadCrumbSiteMap.DataBind();
<telerik:RadSiteMap ID="BreadCrumbSiteMap" EnableViewState="true" runat="server"
DataFieldID="NodeID" DataFieldParentID="ParentNodeid" DataNavigateUrlField="url" DataTextField="NodeName"
OnNodeDataBound="RadSiteMap1_NodeDataBound" >
<DefaultLevelSettings ListLayout-RepeatDirection="Horizontal" SeparatorText="/" Layout="Flow" />
</telerik:RadSiteMap>
在数据绑定中使用此代码,我可以看到每个节点都绑定并具有降序层次结构。 0,1,2,3
<LevelSettings>
<telerik:SiteMapLevelSetting Level="0" MaximumNodes="4">
</telerik:SiteMapLevelSetting>
</LevelSettings>
答案 0 :(得分:0)
布局=&#34;流速&#34;停止下面的所有节点渲染...我不得不删除父节点ID,因此它不是分层的。现在它看起来像我想要的面包屑列表..
DataFieldParentID="ParentNodeid"
https://docs.telerik.com/devtools/aspnet-ajax/controls/sitemap/functionality/layout