on 07-24-2016 5:53 PM
Hi,
What is the way to disable a sap.m.List? Such that we can't select / deselect items, etc.
Thanks
Udi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai Vellank,
Yeh - this is exactly the solution I'm familiar with. Notice how the "View Mode" does not reflect the recent selections
I will try to go for the Overlay idea.
Thanks!!
Hi,
I revised the solution a bit - see below. This way we need to set the list once after each rendering. We don't have to respond to change events.
Again, thanks Sai Vellanki.
Code taken from the Control that generates the List:
var list = new List({
...
includeItemInSelection: "{/enabled}",
...
});
list.onAfterRendering = this._listAfterRender.bind(this);
...
_listAfterRender: function(event){
var list = event.srcControl;
var model = this.model;
var enabled = model.getProperty("/enabled");
var items = list.getItems();
for (var i=0; i<items.length; ++i) {
var item = items[i];
var multiSelect = item.getMultiSelectControl();
if (multiSelect) {
multiSelect.setEnabled(enabled);
}
var singleSelect = item.getSingleSelectControl();
if (singleSelect) {
singleSelect.setEnabled(enabled);
}
}
},
...
Enabled:
Disabled:
Hi again,
Maybe the solution is to use the m.Table and set the showOverlay to true (for disable).
like your opinion...
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Udi
here is an example
JS Bin - Collaborative JavaScript Debugging
You can set the list mode to sap.m.ListMode.None
Thanks
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis Seah,
Thanks for the quick reply!
I'm familiar with this option. Unfortunately I can't use it: I need to show View / Edit mode for the same UI - view should present all the info, just not editable.
in ListMode.None we don't see what items are selected...
Thanks!
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.