filter header dhtmlxgrid

Hi,



I want to put filters in the header and it gives me an error when I loading my page� Error line 837: _locator is null or not an object…

I would like to know how to fill the combo box of a filter?



Here is the code:



























Records found:




var gridQString = “”;

var mygrid = new dhtmlXGridObject(‘products_grid’);



mygrid.setImagePath("…/…/…/class/dhtmlxgrid/codebase/imgs/");

mygrid.setHeader(“User Name,Courriel,Service”);

mygrid.attachHeader("#text_filter,#text_filter,#select_filter");

mygrid.setInitWidths(“200,200,300”);



mygrid.setColAlign(“left,left,right”);

mygrid.setColTypes(“ed,ed,ed”);

mygrid.setColSorting(“server,server,server”);

mygrid.enableMultiline(true)

mygrid.init();

mygrid.setSkin(“modern”);

mygrid.enableSmartRendering(true);



gridQString = “getGridRecords.asp”;//save query string to global variable (see step 5 for details)

mygrid.loadXML(gridQString);



Such error can occur if you are using smart rendering with dyn. loading
If not all data loaded at once, grid not able to use client side filtering and sorting ( because it need to have all data available for such operation )

Yes I used smart rendering with dyn. loading… So what is the solution?

If you are using smart rendering with dyn.loading you can use server side sorting


I already used the server side sorting but the problem is the function attachheader… Do you have a simple with smart rendering and filter header? This is all my code:



var gridQString = “”;



var mygrid = new dhtmlXGridObject(‘products_grid’);



mygrid.setImagePath("…/…/…/class/dhtmlxgrid/codebase/imgs/");



mygrid.setHeader(“User Name,Courriel,Service”);



mygrid.attachHeader("#text_filter,#text_filter,#select_filter");



mygrid.setInitWidths(“30,200,300,400”);



mygrid.setColAlign(“center,left,left,right”);



mygrid.setColTypes(“img,ed,ed,ed”);



mygrid.setColSorting(“int,str,str,str”);


mygrid.setColumnIds(“0,-1,1,2”);


//mygrid.enableColumnMove(true);



mygrid.init();



mygrid.setSkin(“modern”);



mygrid.enableSmartRendering(true);


gridQString = “getGridRecords.asp”;//save query string to global variable (see step 5 for details)



mygrid.loadXML(gridQString);


dhtmlxError.catchError(“ALL”, myErrorHandler);




mygrid.attachEvent(“onBeforeSorting”,sortGridOnServer);


function myErrorHandler(type, desc, erData)



{



return false;



}


 



function sortGridOnServer(ind,gridObj,direct)



{


mygrid.clearAll();



mygrid.loadXML(gridQString+(gridQString.indexOf("?")>=0?"&":"?")+“orderby=”+mygrid.getColumnId(ind)+"&direct="+direct);



mygrid.setSortImgState(true,ind,direct);



return false;



}

You can see example here dhtmlx.com/docs/products/dhtmlxG … _srnd.html (this functionality is avalible at PRO version only)

Do you have a sample with smart rendering, filter header, server side sorting and dynamic loading? Because this is what I have and I get the error when I load the page… If I put in commentary this part of code :

mygrid.attachEvent(“onBeforeSorting”,sortGridOnServer);



, i don’t get the error anymore but I cannot sort…

ok, finaly I solved my problem. Thanks for your help.