Hello ,
I have created an input field filter for a table and the code is as follows:
var Input = this.getValue();
//var i = 0;
var res = Table_1.getDataSource().getMembers("BSTNK");
//var inputDim = ArrayUtils.create(Type.string);
var filter_data = [""];
if (Input === "") {
Table_1.getDataSource().removeDimensionFilter("BSTNK");
Chart_1.getDataSource().removeDimensionFilter("BSTNK");
Chart_2.getDataSource().removeDimensionFilter("BSTNK");
Chart_3.getDataSource().removeDimensionFilter("BSTNK");
} else {
for (var i = 0; i < res.length; i++) {
if (res[i].description.startsWith(Input)) {
filter_data.push(res[i].description);
}
}
Table_1.getDataSource().setDimensionFilter("BSTNK", Input);
Chart_1.getDataSource().setDimensionFilter("BSTNK", Input);
Chart_2.getDataSource().removeDimensionFilter("BSTNK");
Chart_3.getDataSource().removeDimensionFilter("BSTNK");
}
This searches exactly for the text that I entered in the input control, but what I want to achieve is that it searches the records, if I only enter a certain part of the string, for example if the total text is "540-P04", so I can simply search for it putting "540" .
What part of the code I have should I improve or change?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.