cancel
Showing results for 
Search instead for 
Did you mean: 

setFilterFunction method of input control in not getting triggered in sap.ui.table.Table?

Former Member
0 Kudos

i have created a table in which i have columns as input control i want to trigger setFilterFunction of input but its not? How can we fix this is there any other way to call the setFilterFunction.

this.oModel = new JSON({
"columns":[{"columnName": "ID"},{"columnName": "Name"},
{"columnName": "RollNo"}],
"rows":[{"ID":"123","Name":"David","RollNo":"37"},
{"ID":"124","Name":"Smith","RollNo":"38"},
{"ID":"125","Name":"Maxi","RollNo":"39"}]
});<br>this.otable = new Table({
}).setModel(this.oModel);
this.otable.bindColumns("/columns", this.bindColumnToTable.bind(this));
this.otable.bindRows("/rows");
this.getView().byId("tableAttachPoint").addContent(this.otable);
bindColumnToTable:function(sid, oContext){
var colObject = oContext.getObject();
var newColumn = new sap.ui.table.Column({
width: "9rem",
multiLabels: [
new sap.m.Label({
text: "input"
}),
new sap.m.Button({
text:  colObject.columnName
})],
template: this.getInputCellControlForAction(colObject) ,
autoResizable: true
});
return newColumn;
},
getInputCellControlForAction:function(){
var inputForAction = new sap.m.Input({ showSuggestion: true, suggestionItemSelected: this.onActionSeleted.bind(this),
suggest: this.bindItemForSuggest.bind(this)
}).addStyleClass("inputBoxNoBorder");
inputForAction.bindValue(colObject.columnName);
inputForAction.addEventDelegate({
     "onAfterRendering": function () {
     inputForAction.setFilterFunction(jQuery.proxy(this.setFilterSug, this));
     }
}, this);
return inputForAction;
},
//this method should trigger
setFilterSug:function(sValue,oItem){
	if (sValue !== " " && sValue !== undefined) {
         return oItem.getText().match(new RegExp(sValue, "i"));
	}
}
Former Member
0 Kudos

Can anyone help on this topic please?

Accepted Solutions (0)

Answers (0)