Categories | Question details Back To List | ||
Filtering Level in TreeGrid 6 I have 4 filters in my Tree Grid Version 6.I am using built - in filter functionality.I am not able to filter the row at level 0.I tried using setFiltering method to the gird and set the level as 0. What it happens was it applies the level to all the filters available in my grid. But i should have level 0 for my filter 1, level 1 for my filter 2 like that. Is there any way to apply the filtering level to each of the filters in grid or the level can be applicable to all off the filters in the grid. Answer posted by Support on Oct 06, 2008 07:48 >>applies the level to all the filters available in my grid. This is expected behavior, level settings common for all filters. >>Is there any way to apply the filtering level to each of the filters There is no way to achieve such functionality with built in filters. It possible to create custom input box in header, in such case you will be able to to call grid.filterBy for each column separatly with corrent grid.setFilteringLevel value. Answer posted on Oct 06, 2008 09:31 It would be great if you can provide me the sample custom code for setting filtering level in the filerby function. Thanks in Advance.
Answer posted by Support on Oct 07, 2008 02:08 Sample sent by email. mygrid.attachHeader("#text_filter,#text_filter,---") ... var single_run=true; mygrid.attachEvent("onFilterStart",function(a,b){ if (!single_run) return true; //block event recursion single_run=false; mygrid.setFiltrationLevel(1); mygrid.filterBy(0,b[0]); mygrid.setFiltrationLevel(-1); mygrid.filterBy(1,b[1],true); single_run=true; }); Answer posted on Oct 07, 2008 10:07 Thanks ..It works fine.But there are two issues. 1) Performance is not so good when i attach the event onFilterStart.Is there any way to improve performance? 2) I have one of my filter as Select filter.The select filter is not working properly when i choose the empty value in the dropdown.Could you please provide the solution for that .Here is the code i used in my JSP mygrid3.setFiltrationLevel(0);
Index 3 is the select filter. Thanks in advance.
Answer posted on Oct 08, 2008 01:33 >>1) Performance is not so good when i attach the event onFilterStart Can be done only by code modification dhtmlxtreegrid_filter.js dhtmlXGridObject.prototype.filterTreeBy=function(column, value, preserve){ ... this._renderSort() this.callEvent("onGridReconstructed",[]) } The last two lines can be removed from filterTreeBy function and added to the end of your custom code >>2) I have one of my filter as Select filter.The select filter is not working properly when i choose the empty value in the dropdown. When empty value selected, such column just ignored while filtering If it works in some different way - please provide mode details about incorrect behavior. Answer posted on Oct 09, 2008 07:49 Please find the more details of the incorrect behaviour of select filter The select filter has list of values such as Assocaite,GDC Onshore,GDC Offshore,Contractor.Also blank value has appended to the select dropdown. Scenarios when the choose any of the value apart from the blank , filters work fine.Let say i choosed Associate, then it filters all the Associates.Now if i choose blank , it has to display all the rows in the grid.Instead it is not displaying all rows. Thanks in advance.
Answer posted by Support on Oct 09, 2008 08:08 The select filter which you mean, is it created by #select_filter or some custom select box converted to the filter by makeFilter method ? Answer posted on Oct 09, 2008 08:55 The select filter is created by using #select_filter . I tried with the above solution,Still it is not working. Answer posted by Support on Oct 09, 2008 09:19 Problem is not reconstructable locally The code of dhtmlxgrid_treegrid_filter.js has hardcoded rule, so if empty string come as filtering value - the grid just skip this parameter (accepts all row) Answer posted on Oct 15, 2008 13:28 I have two girds.Requirement is to drap and drop a row from first grid to the second. My second grid has large number of rows.When i tries to filter a parent row which has project name and drop the resources under the project.Resource is correctly dropped to the appropiate filtered project.Now i cleared the entered project name in the filter box , then it displays all rows.After that i tried to filter the same project, that time it was not displaying the resource which i newly dropped. Looks like it is not taking state of the grid.Please let me know how to acheive this scenarios.Thanks in Advance.
Answer posted by Support on Oct 16, 2008 02:56 If you have executed some operation while grid in filtered state ( row adding , deleteing ) - they will not affect original structure and will be revert after you switch off filtering. While it possible to use some workaround for simple add|delete operations, it will require a pretty complex code in case of d-n-d to work correctly in filtered state. http://dhtmlx.com/docs/products/kb/index.shtml?cat=recent&q=3752 Answer posted on Oct 16, 2008 09:35 It would be great help if sample is provided.Thanks in advance. Answer posted by Support on Oct 16, 2008 09:53 Something similar to next will work mygrid.attachEvent("onDrag",function(sid,tid){ mygrid.filterBy(0,""); window.setTimeout(function(){ mygrid.filterByAll(); },1) return true; }) the code clear filtering when d-n-d occurs, and restore it back after item added to the tree. Full sample sent by email. Answer posted on Oct 16, 2008 12:10 I havent received any full sample.Can you please mail me that. Thanks in advance.
Answer posted by Support on Oct 17, 2008 03:52 If you still haven't received email with the sample, please contact us directly at support@dhtmlx.com Answer posted on Oct 23, 2008 15:04 I had tried trimming the blank values in the select filter with the below mentioned code b[3]=b[3].toString()._dhx_trim(); what i noticed was when i select blank value in the filter box, the onFilterEvent block is not even executed.Thats the reason , it is not displaying all the rows when blank value is selected. Please help me on this.Thanks in advance.
Answer posted by Support on Oct 24, 2008 02:07 In case of select filter -filtering triggered by onChange event , so any change in select box must exec onFilterStart event In case of text event - filtering triggered by onkeydown event, any key action in filter box will trigger event ( it may be not trigered if you have changed text by mouse actions ) The event will not occur for custom filters, which use direct filterBy calls. |