cancel
Showing results for 
Search instead for 
Did you mean: 

SmartTable - Get the Selected Table Row Data

6,569

Hi,

Unable to get the Selected Row Data in a SmartTable .Tried to implement the fieldChange event but it is not even trigger when any checkbox is selected.

On XML View fieldChange="onFieldChange"

Controller: onFieldChange : function(oEvent){ debugger; }

Also Tried ->Button Press event

var ob = this.getView().byId("LineItemsSmartTable").getTable().getSelectedIndices(); -> I am getting the list of Selected index in an array but from index how to get the complete row data.

The Requirement is on click of submit button process the selected records as a post call.

View Entire Topic
former_member524141
Participant

Hi Sunil,

Use below code,on button press event.

var oItems = oTable.getSelectedIndices();
      for (var i = 0; i < oItems.length; i++) {
        j = oItems[i];
        var l_ekgrp = oTable.getContextByIndex(j)
          .getProperty("Docnum");
        // and fetch rest of fields in similar pattern
 
}

And as Mahesh Kumar Palavalli mentioned Field change event is not required in your case. It is for data change of fields.

0 Kudos

Thanks Ravi