Hi,
I have a filter attached to a TreeGrid as footer. Because I need our own customized filter, so I attached as:
gehcdirectoryPanel.attachFooter("
+“Filter : <input id=‘olc_filter’ type=‘text’ size=‘20’”
+"/>
+",#cspan,#cspan,#cspan",[“height:25;font-style:italic;font-family:Verdana;font-size:11px”,"","",""]);
function setFilterOLC() {
//cancelEventBubble();
//trim
$("olc_filter").value =$F("olc_filter").replace(/^\s+|\s+$/g, '');
if (!gehcdirectoryPanel.filters) gehcdirectoryPanel.filters=[];
gehcdirectoryPanel.setFiltrationLevel(-2, false, false);
if ($F('olc_filter').match(new RegExp('^\\\*+$')) || ($F('olc_filter') == ''))
gehcdirectoryPanel.filterByAll();
else
gehcdirectoryPanel.filterBy(0, function(data){return myFilter(data, $F('olc_filter'));}, false);
}
function myFilter(data, filterVal) {
// if not start ‘’, put ^ at start for ReExp
if (filterVal.match(new RegExp(’^[^\*]’)))
filterVal = ‘^’ + filterVal;
// if not end '’, put $ at end for ReExp
if (filterVal.match(new RegExp(’[^\*]$’)))
filterVal = filterVal + ‘$’;
filterVal = filterVal.replace(/./g, ‘\.’);
filterVal = filterVal.replace(/*/g, ‘.*’);
if (data.match(new RegExp(filterVal))) {
return true;
} else
return false;
}
function cancelEventBubble() {
if (window.event)
window.event.cancelBubble = true;
}
But problem is, I can type the text in the filter input box, but I can NOT selecting the text, if I need to remove it, I need to keep hitting the back space, it’s kind of annoying.
Could you please help me to enable the selecting text?
Thank you