on 04-26-2017 1:39 PM
Hi Experts,
am trying to create a smart table which needs to have an editable column. We are using the OData metadata to generate the columns in smart table. We have smart table property (editable = "true") which is making all columns in table are editable. But i need to have only single column as editable column. Please find the screenshot for sample screen.
Kindly suggest how we can achieve this.
You need a few things in place to control the editing of fields in your SmartTable
Notes:
customData namespace is defined in your view xml
xmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
onFieldChange is defined in your view controller file and would contain the logic to set changes back to your webservice
onFieldChange: function(evt) {
var change = evt.getParameter("changeEvent");
if (change) {
var newValue = change.getParameter("newValue");
var src = change.getSource();
// get the data binding and send the changes via your appropriate web service
}
},
There are few ways to define TwoWay binding on an OData model, one is to add defaultBindingMode to your manifest file
"models": {
"": {
"dataSource": "myDataSource",
"settings": {
"useBatch": false,
"defaultBindingMode": "TwoWay"
}
}
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mahenaz!
I got it to work. The most important thing is the two-way binding. You have to be sure that the custom values are bind. Otherwise you won't be able to scroll.
Regards
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Yarragudi,
Did you find the solution ? I am facing the same issue.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Farouk,
We can create custom fields in smart table.
Please follow the link given by Akhilesh.
sample code: create a table inside smart table like below.
<Table> <columns> <Column width="100px" hAlign="Left"> <customData> <core:CustomData key="p13nData" value='\{"columnKey": "Dmbtr", "maxLength": "5","columnIndex":"4", "leadingProperty": "Dmbtr"}' /> </customData> <Text text="{/#LineItems/Dmbtr/@sap:label}" /> </Column> </columns> <items> <ColumnListItem> <cells> <Text text="{Dmbtr}" /> </cells> </ColumnListItem> </items> </Table>
Regards,
Chandra
I think you can define customData for this column and use "enabled" property to input field. check below link if it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
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.