Skip to Content
0

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

Jan 10, 2017 at 05:26 AM

88

avatar image
Former Member

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"));
	}
}
10 |10000 characters needed characters left characters exceeded
Former Member

Can anyone help on this topic please?

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers