on 01-10-2017 5:26 AM
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"));
}
}
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.