on 04-18-2016 6:02 AM
Hello Experts,
I have created a table with delete functionality as per the type delete of table as below.
Unfortunately the delete functionality is not working on clicking the delete button, below is the code I have written in JS base on information I got online.
I am not able to get value in variable oRowData from the method oModel.getData because of which it is not recognize the splice method.
I have searched some site and was able to get this code implementation only to delete row, also I observed the table was created using Java Script as per code online but in my case I have created through layout editor in XML, is the the problem here?
Request you help here..
Will reward accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am able to get model but not the data thru getData
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
from the binding context, you can also get the model
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have already referred the link JS Bin - Collaborative JavaScript Debugging but the problem there the table is created with JS but in my case with layout editor and because of that I am also not sure where to find ModelName as it is not defined anywhere while table creation.
I am getting data from oData services
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello KC,
here's how i did it:
You have to give your table an ID. in my case "grTable".
The ColumnListItem in my Table:
<ColumnListItem press="onPositionsTableItemPress" type="Active" >
And here's my onPositionsTableItemPress:
oSelectedModel is the Model in your JSON which was clicked on. In your case it would be smth like
.getModel().getData().splice(iSelectedItemIndex, 1):
Regards
Samuel
Hi K C,
Your model must be having a name, try passing the model name
var sPath = oItem.getBindingContext("yourModelName").getPath();
var oModel = oTable.getModel("yourModelName");
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can refer to the example here - JS Bin - Collaborative JavaScript Debugging
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.