I tried to see how onFilterStart event work and did simple modification to a 05_pro_filter_srnd.html pagein dhtmlxGrid\samples\08_filtering directory like so:
/* added sample filter button --*/
<input type="button" value="filter" onclick="doFilter('apple')" />
then factory provided code goes with some additional event handlers like so:
var mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../../codebase/imgs/");
mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping");
mygrid.attachHeader(" ,#text_filter,#select_filter, ,#cspan,#cspan");
mygrid.setInitWidths("50,150,120,80,80,80,80,200")
mygrid.enableAutoWidth(true)
mygrid.setColAlign("right,left,left,right,center,left")
mygrid.setColTypes("dyn,ed,ed,price,ch,co");
mygrid.getCombo(5).put(2,2);
mygrid.setColSorting("int,str,str,int,str,str")
mygrid.setSkin("dhx_skyblue")
mygrid.init();
mygrid.enableSmartRendering(true);
mygrid.loadXML("../common/500.xml");
/*--- event handlers added---*/
mygrid.attachEvent("onFilterStart", function (indexes, values) { alert('filter start'); return true; });
mygrid.attachEvent("onFilterEnd", function (elements) { alert('filter end'); return true; });
function doFilter(val) {
mygrid.filterBy(1, val, true);
}
when filter row filters used, event fires no problem, but when I clicked button Filter events are bypassed but grid gets filtered.
Is anything missing in my code?