jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › Treegrid method similar to the Grid method for getting filter information?
This topic contains 9 replies, has 2 voices, and was last updated by Alastair Walker 6 months ago.
-
Author
-
June 25, 2024 at 12:59 pm Treegrid method similar to the Grid method for getting filter information? #134944
In the jqxGrid widget there is a method for ‘getfilterinformation’ – which is very useful.
I am trying to use the Treegrid widget for a similar purpose. I have looked for a method similar to ‘getfilterinformation’ – but do not see one.
Is there a work around/ alternative to achieve a similar end result?
Any guidance on this matter will be really appreciated!
Many thanks,
Alastair
June 25, 2024 at 9:36 pm Treegrid method similar to the Grid method for getting filter information? #134948Hi Alastair,
This code will return all filters applied to the treegrid:
$("#treeGrid").jqxTreeGrid('dataview').filters
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/June 26, 2024 at 9:23 am Treegrid method similar to the Grid method for getting filter information? #134949Hello – Peter – thank you for the response.
When I invoke the function as described, I get returned to me the operator value e.g. ‘and’ and the applicable data field value e.g. ‘id’.
How do I access the filter value as entered in the filter window e.g. ‘3’, if the intended filter expression is ‘id = 3’?
Many thanks,
Alastair
June 27, 2024 at 2:50 am Treegrid method similar to the Grid method for getting filter information? #134950Hi Alastair,
For example:
The $(“#treeGrid”).jqxTreeGrid(‘dataview’).filters returns and array of filters applied to the TreeGrid. Each object in that array has “datafield” – the column’s datafield with the filter and “filter” which contains the filter group applied to the “datafield”..
$(“#treeGrid”).jqxTreeGrid(‘dataview’).filters[0].filter.getfilters() – this returns all filters in the filter group.For example:
[{ condition: "CONTAINS", operator: 0, type: "stringfilter", value: "laura" }]
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/June 27, 2024 at 12:17 pm Treegrid method similar to the Grid method for getting filter information? #134953Hello – Peter,
This method now works well! Thank you!
A further question though.
jqxGrid has a similar method for obtaining information on sorting data as ‘getsortinformation’.
Is there a similar set of methods applicable to jqxTreeGrid?
Any guidance on this will also be appreciated!
Alastair
June 29, 2024 at 5:25 am Treegrid method similar to the Grid method for getting filter information? #134984Hi Alastair,
$(“#treeGrid”).jqxTreeGrid(‘sortcolumn’) and $(“#treeGrid”).jqxTreeGrid(‘sortdirection’); will give you information about the sort column and direction.
Hope this helps.
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/June 29, 2024 at 12:21 pm Treegrid method similar to the Grid method for getting filter information? #134987Thank you very much!
Alastair
October 18, 2024 at 10:16 am Treegrid method similar to the Grid method for getting filter information? #135441Hello – Peter,
Further to my earlier note, if I use the following test:
try
{
sortColumn = jQuery(selector).jqxTreeGrid(‘sortcolumn’);
}
catch(err)
{
console.log(‘JS ‘ + ‘ ‘+ err);
}I get the error message ‘jqxCore: Invalid parameter ‘[sortcolumn]’ does not exist.’
Any guidance here will be appreciated!
Alastair
October 21, 2024 at 7:14 am Treegrid method similar to the Grid method for getting filter information? #135445Hi,
You can try this instead $(“#treeGrid”).jqxTreeGrid(‘getInstance’).sortcolumn.
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/October 23, 2024 at 1:59 pm Treegrid method similar to the Grid method for getting filter information? #135448Hello – Peter,
When I try:
var sortColumn = jQuery(selector).jqxTreeGrid(‘getInstance’).sortcolumn;
sortColumn is returned as ‘undefined’.
Note: The treegrid widget was set up in its properties to be sortable, and secondly, a column was clicked to ensure a valid sort direction.
Alastair
-
AuthorPosts
You must be logged in to reply to this topic.