Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Hugh Lomas on Sep 12, 2008 11:08
open dhtmlx forum
Filtering in smart rendering mode with Grid


Hello, I am attempting to set up filtering for a smart-render grid. I am having trouble getting it to work. It loads the results dynamically as you scroll, and the sorting works perfectly. I am very pleased with the performance and the product. The filtering is a rather vital part though and I really want it to work properly.

Typing in the filter boxes produces no reaction or XMLHTTPRequest to the server, just nothing happens, and the select filters are not filled with any values.

Here is a screenshot:
http://img154.imageshack.us/my.php?image=filterexamplehh9.jpg

I did make sure to include the ext/dhtmlxgrid_filter.js and all of the others dhtmlx javascripts (common, grid, gridcell, srnd) as well.

Below is the current javascript code that I am using, please help me identify any issues.

Thank you,
Hugh Lomas


/********************************************************************
var allaccountsdatagrid = new dhtmlXGridObject('accountsdatagrid');

allaccountsdatagrid.setImagePath('classes/dhtmlx/dhtmlxGrid/codebase/imgs/');

allaccountsdatagrid.setHeader('Account Name, Cleaned By, Office, Billing, Active, Suspended, Type');

allaccountsdatagrid.setInitWidths('*, *, *, *, *, *, *');

allaccountsdatagrid.setSkin('light');allaccountsdatagrid.setColTypes('Array');

function sortGridOnServer( indirect, gridObj, direct){
allaccountsdatagrid.clearAll();
allaccountsdatagrid.loadXML( gridQString + ( gridQString.indexOf('?') >= 0 ? '&' : '?' ) + 'orderby=' + indirect + '&direct=' + direct );
allaccountsdatagrid.setSortImgState( true, indirect, direct );
return false;
}

allaccountsdatagrid.attachEvent('onBeforeSorting', sortGridOnServer );

allaccountsdatagrid.setColSorting( 'server,server,server,server,server,server,server' );

allaccountsdatagrid.attachHeader('#text_filter,#select_filter,#select_filter,#numeric_filter, #select_filter,#select_filter,#select_filter');


allaccountsdatagrid.enableSmartRendering(true);

allaccountsdatagrid.init();

var gridQString = 'request/RequestManager.php?request=DataGridAccountsRequest';allaccountsdatagrid.loadXML( gridQString );

allaccountsdatagrid.loadXML( gridQString );

/******************************************************************


Answer posted by Support on Sep 15, 2008 01:32
Filter boxes such as #text-filter, #text-search are client-side filters. In order to carry out server-side you should use another approach. Please, see the article in the documentation:
 dhtmlxGrid/doc/step-by-step/ch_biggrid.html 
or on our web site 
http://www.dhtmlx.com/docs/products/dhtmlxGrid/doc/step-by-step/ch_biggrid.html.

Moreover you can find a ready sample in the documentation (with PHP as a server-side language): 
dhtmlxGrid/samples/loading_big_datasets/50000.html
the version on the web site is http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/loading_big_datasets/50000.html