on 03-07-2019 12:53 PM
Hello Team,
I have one requirement in our project where I need to add an empty row for the Smart Table table type - Grid Table, on click of add button. I have explored few of the blogs but couldn't find relevant suggestions. I also tried to use standard method addRow for the grid table, but I am getting error - "The control manages the rows aggregation. The method "addRow" cannot be used programmatically!". But we want to provide a justification to client that why this standard method can't be used.
Hi RAAGA PRIYA S,
OData v2 model doesn't support the table binding update if you want to insert the data locally without sending the request to the backend. Smartable is tightly integrated with OData model. Infact Odata v4 model also doesn't support it completely.
If you want to create an entry, then you need to show a popup let the user enter the data and on click of save in the popup then you need to submit the changes to the backend. Then the smart table will be updated with the new entry. BTW you cannot mix json model and smart table together.
Else, simply use a normal table with json binding and add a new record to the json model data which wil automatically show the new record in the table and you can perform changes there.
https://blogs.sap.com/2016/10/11/addremove-rows-sap.m.table-quick-reference/
BR,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Raaga,
Add an empty record to the JSON model bound to the table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abdul,
I have bound the smart Table using OData model. Application is of Master-Detail type,smart table gets the data based on the list selected from the Master page. Hence I have used OData Model. Any methods to add an empty row, when the table is in edit mode?
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.