on 12-18-2014 12:24 PM
Hi All,
I want to know,while run the app, how can i set the first row default select..I have done for desktop app through setSelectedIndex(0); method..for mobile how can i set? for example we'll take example JS Bin - Collaborative JavaScript Debugging in that app how can i set the first row default select..
Thanks & Regards,
Palsaran
Set your m.Table to mode="MultiSelect"
and set the first item selected.
In a mobile environment it doesn't make sense to have a single-select table preselected, so you have to use multiselect instead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pal,
Here is a JS Bin sample.
The sample creates a table, gets its' items, then sets the first item as selected:
var oTable = new sap.m.Table({
mode : "MultiSelect",
columns : [
new sap.m.Column({ header: new sap.m.Label({ text: "ID" }) }),
new sap.m.Column({ header: new sap.m.Label({ text: "Fruit" }) })
],
items : [
new sap.m.ColumnListItem({
cells: [
new sap.m.Text({ text: "1" }),
new sap.m.Text({ text: "Apple" })
]
}),
new sap.m.ColumnListItem({
cells: [
new sap.m.Text({ text: "2" }),
new sap.m.Text({ text: "Orange" })
]
})
]
}).placeAt("content");
var aItems = oTable.getItems();
aItems[0].setSelected(true);
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.