on 03-22-2017 7:45 AM
I am using sap.m table. I am using followind coding...
<?xml version="1.0" encoding="UTF-8"?><Table items="{ztabledata>/results}" selectionBehavior="RowOnly" selectionChange="selectionChangeEditProfile" id="idEditProfileDetailsTable" mode="SingleSelectMaster"><columns><Column width="12em"><Text text="{i18n>LLMName}" /></Column><Column width="12em"><Text text="{i18n>LLMCode}" /></Column></columns><items><ColumnListItem><cells><Text text="{ztabledata>Lmname}" /><Text text="{ztabledata>Lmnode}" /></cells></ColumnListItem></items></Table>
This solution is for the m.Table, not ui.table---
View:
Ensure your Table has itemPress defined
<Table itemPress="onItemPress">
Ensure your Table ColumnListItem tags have type defined
<ColumnListItem type="Active">
Controller:
onItemPress:function(oEvent){
this.oLastSelection;
var oCurrentSelection= oEvent.getSource().getSelectedItem();
if(!this.oLastSelection){ //if it has no value
this.oLastSelection= oCurrentSelection; //set it as the current selected item
} else if(this.oLastSelection===oCurrentSelection){ //else if its value is the same as the current selection
oEvent.getSource().removeSelections(true); //remove selection
this.oLastSelection= null; //reset last selected item
} else{ //otherwise, set last selected item as current
this.oLastSelection= oCurrentSelection;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use below Code, this will work for sure.
this.byId("idEditProfileDetailsTable").clearSelection();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
clearSelection is only applicable to ui.table, for m.table you use removeSelections(true)
use list mode : MultiSelect which will have unselect option
Best Regards,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.