当TreePick由DataSource填充时,如何使最后一个Item成为叶子



我使用的是SmartGWT 2.5。

我想使用这里显示的相同示例

正如您在Department菜单中看到的,我们可以'设置CanSelectParentItems(false) For Category menu, if we设置CanSelectparentItems(false), it allows us to select only the null item with label[空菜单]'。

当TreePick由DataSource填充时,我想让最后一个Item变成叶子吗?然后使用mCategory.setCanSelectParentItems(false); 禁用父项选择

你能告诉我怎么做吗?

    categoryItem.setDataSource(dataSource);  
    categoryItem.setEmptyMenuMessage("No Sub Categories");  
    categoryItem.setCanSelectParentItems(true);          
    categoryItem.setLoadDataOnDemand(false);
    dataSource.fetchData();  

//将按需加载设置为false

相关内容

最新更新