Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Issue with Table UI Row Selection

$
0
0

Hello Experts, I am trying to use a table UI element and trying to read the row selected. However the below code does not seem to work.

Also I dont see any entry in firebug DOM for console variable rowselect.

 

var oTable = new sap.ui.table.Table({

                                                id: "Customers",

                                    title: "Customers",

                                    visibleRowCount: 7,

                                    firstVisibleRow: 3,

                                    selectionMode: sap.ui.table.SelectionMode.Single,

                                  

                                 

                                   

                            });

 

       var oModel = new sap.ui.model.json.JSONModel();

                            oModel.setData({modelData: aData});

                            oTable.setModel(oModel);

                            oTable.bindRows("/modelData");

                                      oTable.sort(oTable.getColumns()[1]);

                                    oTable.placeAt("master");    

 

 

                            oTable.attachRowSelect(function(oEvent) { 

                                       var rowselect = oEvent.getParameter("rowContext"); 

                                       oTable.setBindingContext(rowselect);  

                                       console.log(rowselect);

                                      }); 

 

.......

Also tried:  selectedContext = oTable.getContextByIndex(oTable.getSelectedIndex());  the problem is I dont get "getSelectedIndex option in oTable.

 

Any pointers?

 

thanks, Justin


Viewing all articles
Browse latest Browse all 6178

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>