Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Guido Dubois on Jul 08, 2009 03:12
open dhtmlx forum
Smart Render grid filter problem.

I'm trying to make an filter function for a smart render grid.
To load the ajax request it takes sometimes 2 or 3 seconds, becease of the complexibility of the query I use.

The filter works but that's it.
If i'm filtering on multiple fields, the grid runs multiple ajax requests at one time and waits! until all the requests are loaded.
So this takes a while (10 secends and up) befor i see any result.

By searching on the knowledge base, I found a solution: mygrid.xmlLoader.xmlDoc.abort() ;
But if i'm using it, it gives me a LOAD XML error back as an alert.

How can I fix this so i don't get this error's or the grid doesn't runs multiple ajax requests at one time (only the latest )?
And is there a propper way to block the loading if the filter isn't changed sinds the last time?


attachEvent("onFilterStart",function(a,b){
bString = b;
if((filterBlock[0] == bString[0]) && (filterBlock[1] == bString[1]) && (filterBlock[2] == bString[2]) && (filterBlock[3] == bString[3]) && (filterBlock[4] == bString[4])){ return true;}
myTable.xmlLoader.xmlDoc.abort();
filterBlock = bString;
myTable.clearAll();
url = gridQString+'&b[0]='+b[0]+'&b[1]='+b[1]+'&b[2]='+b[2]+'&b[3]='+b[3]+'&b[4]='+b[4];
myTable.loadXML(url);
return false;
});
Answer posted by dhxSupport on Jul 08, 2009 06:12
You can catch incorrect xml error using:
dhtmlxError.catchError("LoadXML", myErrorHandler);
function myErrorHandler(type, desc, erData){
 
return false;
}
After that alert will not appear
Answer posted by Guido Dubois on Jul 08, 2009 23:04
Is there a better way get this big amount of records and to search in the amount of records by the head filter, or is this the only way to do this with dhtmlx?
Answer posted by dhxSupport on Jul 09, 2009 00:57
You can try to use dhtmlxConnectors extension which can help you implement dynamic loading, server side filtering and searching. Please see more information here http://www.dhtmlx.com/docs/products/dhtmlxConnector/index.shtml