Categories | Question details Back To List | ||
filter on grid say 'row is null' Hi, We're using the Enterprise edition of dhtmlx suite. All working great so far, however I'm having some trouble using filers on a grid. Here is what I am doing: var ajaxNumbersGrid; function ajaxNumbersGridInit() { ajaxNumbersGrid = new dhtmlXGridObject('ajaxNumbersGridContainer'); ajaxNumbersGrid.setImagePath("/3rdparty/dhtmlx/imgs/"); ajaxNumbersGrid.setHeader("Number,DDI,Network,Tariff,Usage,Allocated,Notes"); ajaxNumbersGrid.setInitWidths("100,100,80,80,80,200,*"); ajaxNumbersGrid.setColAlign("left,left,left,left,left,left,left"); ajaxNumbersGrid.setColSorting("str,str,str,str,str,str,str"); ajaxNumbersGrid.setColTypes("ro,ro,ro,ro,ro,ro,ro"); ajaxNumbersGrid.enableMultiselect(true); ajaxNumbersGrid.setSkin("light"); ajaxNumbersGrid.enableSmartRendering(true,50); ajaxNumbersGrid.makeFilter("filterNumber",0); ajaxNumbersGrid.init(); var url="data.php"; url=url+"?sid="+Math.random(); ajaxNumbersGrid.loadXML(url); } The filterNumber filter is not working. When I type in the input box Firefox errors 'Row is null'. I am using the alli-in-one js and css files. Please help. Answer posted by dhxSupport on Mar 06, 2009 05:20 We cannot reproduce this problem locally. Please provide sample where this issue occurs including files which you are using to initialize grid directly to the support@dhtmlx.com Answer posted by mallchin on Mar 06, 2009 06:28 Hi, Thank you for the quick response. I have been testing the issue and narrowed down the cause, I cannot sort the grid or filter columns unless all data is loaded. I can load all data by scrolling through the entire grid before sorting, I assume this caches the data locally. The docs seem to suggest it is possible to filter and sort using smartRendering, is there anything special to do this? I can't send files as the data.xml contains sensitive data and has 77,000+ records. I tried to create a sample with only 10 records but it worked as the data was sent in one chunk and was cached locally. It only fails if only part of the dataset is sent to the client using smartRendering. Thanks, Martin Answer posted by dhxSupport on Mar 06, 2009 07:03 It seems you are using dinamic smart rendering mode when not all grid's rows are loading from the server. In this case the only way filter data - using server side sorting. Answer posted by mallchin on Mar 06, 2009 07:22 Yes, I am using dynamic smart rendering. I see a method for server-side sorting, that should solve that issue. I can't see any method for client-side filtering though. I would like to filter columns based on input text, is this possible using dynamic smart rendering? One of your examples shows filtering data using an input box with 50,000 records. Does that example not use dynamic rendering? Thanks, Martin Answer posted by dhxSupport on Mar 06, 2009 07:30 >>I can't see any method for client-side filtering though. I would like to filter columns based on input text, is this possible using dynamic smart rendering? Filtering technology which use dhtmlxGrid to filter rows is completly client side. If row have not been loaded from the server filter cannot find it. Probably in some cases filtering will not return error, but if you will try to find row wich have not been loaded - some issues can occurs. >>One of your examples shows filtering data using an input box with 50,000 records. Does that example not use dynamic rendering? This example (http://dhtmlx.com/docs/products/dhtmlxGrid/samples/loading_big_datasets/50000.html) using dinamic smart rendering mode. By the way, if you are using PRO dhtmlxGrid version you can use static smart rendering. In this case client side filtering will work well. Answer posted by mallchin on Mar 06, 2009 07:36 Hi, I've changed to server-side filtering and it is working great, thanks. It is all working here now, although I am still curious how this example works: http://dhtmlx.com/docs/products/dhtmlxGrid/samples/loading_big_datasets/50000.html It suggests it uses client-side filtering using dynamic smart rendering, which is what I wanted to do. Is it filtering on the client or server? Thanks. Answer posted by dhxSupport on Mar 06, 2009 08:52 This example using dinamically Smart Rendering mode. To filter rows we are using server side sorting with help “onBeforSorting” event which available only at PRO version. Answer posted by mallchin on Mar 09, 2009 02:14 Aah okay, that explains it, thank you. |