on 04-30-2017 10:46 AM
Hi All,
In my table, I have created a toolbar which has a display button. When the display button is clicked, a dialog box opens and the data of the selected row is passed to it. But while doing so, I am getting an error - "Uncaught TypeError: oTable.attachRowSelect is not a function".
1. My table -
2. Dialog box -
3. Code -
Please let me know what I am doing wrong?
Regards
Meenakshi
to get the context no need to attach row selected event, even you can get that using row index, check below code may help you
var ind = oTable.getSelectedIndex();
var selectedRow = this.oTable.getAggregation("rows")[ind]
var oContext = selectedRow.oBindingContexts;
//now you can get path from oContext and get property value from model i.e. oModel.getProperty(path + "/AProject");
// or you can get direct values from cells from selectedRow
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
all well, till now your code is correct. you are getting an object in oContext along with one property i.e. undefined
that undefined is nothing but model name, if you have named model then it should be displayed here instead of undefined.
you can get path as : selectedRow.oBindingContexts.undefined.sPath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
why are you attaching the function of the table inside the toolbar? It should be outside toolbar .
Check it .
Regards,
Sharath
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.