PDA

View Full Version : [CLOSED] [#504] Custom Field for Filter Header not working



iansriley
Jun 06, 2014, 5:37 PM
http://examples2.ext.net/#/GridPanel/FilterHeader/Custom_Field/

In the above example, the drop down [Filter] for "size" is not retrieving correct results.
For Example, If i select "Extra Large" in drop down then it is displaying results of "Large" .
I guess TWO WORD filter is not working . The same scenario is occurring in our application
Could u please check and respond accordingly

Daniil
Jun 06, 2014, 9:29 PM
Hi @iansriley,

Thank you for the report.

Please change the getSizeValue function to (on the page):

function getSizeValue() {
var text = [];

this.menu.items.each(function (item) {
if (item.checked) {
text.push(item.text);
}
});

if (text.length == 0) {
return "";
} else {
return "any " + text.join(",");
}
}

Also please change the getValue function to (in custom_behaviour.js):

getValue: function (value) {
var values = Ext.net.FilterHeader.behaviour.getStrValue(value). substring(4).split(","),
tmp = [];

console.log(value);

Ext.each(values, function (v) {
v = v.trim();
if (!Ext.isEmpty(v)) {
tmp.push(v);
}
});

values = tmp;

return { value: values, valid: values.length > 0 };
}

Daniil
Jun 09, 2014, 11:11 AM
It has been fixed online and in SVN (revision #5863).