on 10-06-2016 7:00 PM
I was facing same issue. because I was using Treetable in a fragment. I have used these codes and it worked.
Controller:
in the top of the controller:
function addSelectedFlag(aNodes, bSelected) { jQuery.each(aNodes, function(iIndex, oNode) { oNode.selected = bSelected; if (oNode.categories) { addSelectedFlag(oNode.categories, bSelected); } }); }
onSelect: function(oEvent) { var aItems = oEvent.getParameter("listItems") || [], oModel = this.getView().getModel(); jQuery.each(aItems, function(iIndex, oItem) { var oNode = oItem.getBindingContext().getObject(), bSelected = oItem.getSelected(); if (oNode.categories) { addSelectedFlag(oNode.categories, bSelected); } }); oModel.refresh(); },
View:
<m:Tree id="TreeTableBasic" items="{path:'/questiontree/troubleshooting', parameters: {arrayNames:['categories']}}" mode="MultiSelect" selectionChange="onSelect" ariaLabelledBy="title" includeItemInSelection="true"> <m:StandardTreeItem title="{name} {code}" selected="{selected}"/>
</m:Tree>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using addSelectionInterval or setSelectionInterval method of TreeTable, If you want to orverride previous selections use second option.
Check methods descriptions
addSelectionInterval: SAPUI5 SDK - Demo Kit
setSelecionInterval: SAPUI5 SDK - Demo Kit
Regards,
Sandro Ramos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.