cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can anybody please let me know if we can able to use select index function in the xml view of a simple column-table? If not which is the best possible way to use the same?

Former Member
0 Kudos
195

I am trying to use the select index function in the simple Table-Columns but I am getting the below error:

"Uncaught TypeError: Cannot read property 'getSelectedIndex' of undefined".

When I tried to check the properties in the explorer, I didn't find the property.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

this is how we define in XML view:

var selRowIndex = rowtable.indexOfItem(oSelectedItem)+1;

and for Binding the context as Kuntal Sarkar explained above:


var path= oEvent.getParameter('listItem').getBindingContext().getPath();

var selectedRow= this.byId('Table_ID').getModel().getProperty(path);

Answers (1)

Answers (1)

swaroop_anasane
Active Contributor
0 Kudos

hi Venkatesh,

It looks like it's not getting the control itself.

What are you trying to achieve specifically?

Regards,

Swaroop

Former Member
0 Kudos

ya. your right. there is no property defined for the same when I use the simple Columns-Table XML view. Specifically, want to enable selecting the rows in a table. Which can be editable too.

swaroop_anasane
Active Contributor
0 Kudos

Hi Venkatesh,

The property is there, but using your event, the code is not able to find this property. Check if you are referring to right event, Share the code piece if you still face some problem.

From "Cannot read property 'getSelectedIndex' of undefined", it is evident that the code is not able to get event to call the method.

Regards,

Swaroop

Former Member
0 Kudos

hi Swaroop, thanks for your quick response. I have found the solution, the XML view doesn't support getSelectedIndex function, so used rowSelectionChange which will solve the issue.

thanks.