on 11-18-2013 8:52 AM
Hi,
I have a table which is being populated through sap.ui.model.json.JSONModel(). I want to delete selected row from table.
Kindly suggest how to achieve this?
Hi Ash,
Simply create a button which in the onPress event removes the selected entry from your JSON model using the getIsSelected() method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a delete link on each row of the table. On click of link it should delete that row from table as well as JSON model?
//table
var oTable = new sap.ui.table.Table({
//title: "Table Example",
id: "Tab1",
selectionMode: sap.ui.table.SelectionMode.Single,
selectionBehavior:sap.ui.table.SelectionBehavior.RowOnly,
visibleRowCount: 5
});
//Define the columns and the control templates to be used
var oColumn = new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Rule name"}),
template: new sap.ui.commons.TextView().bindProperty("text", "ruleId"),
sortProperty: "ruleId",
filterProperty: "ruleId",
width: "250px"
});
oTable.addColumn(oColumn);
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Rule Effect"}),
template: new sap.ui.commons.TextField().bindProperty("value", "ruleEffect"),
sortProperty: "ruleEffect",
filterProperty: "ruleEffect",
width: "250px"
}));
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Action"}),
template: new sap.ui.commons.Link({
text: "Delete",
tooltip: "Delete the rule",
press: function() {deleteRow();}}),
width: "250px"
}));
User | Count |
---|---|
79 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.