jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › tree grid filtering and a navigation
This topic contains 10 replies, has 2 voices, and was last updated by lenaykt 9 years, 9 months ago.
-
Author
-
Dear all,
I do not have much IT experience and English is also bad. Anyway, I will appreciate very much your help… I have custom buttons to move from one deepest item to another deepest item. So, if I find an element I expand their parents to make my item visible. I increase or decrease ID’s (may be not so good idea?) to perform a navigation since a tree grid doesn’t have a nextItem(prevItem) method. I use paging. And If elements moves to another page I also want to move to another page. Is it possible? Is there a function to get current page number and move to the next or previous page?
Thanks.
And one more question. why “getView” doesn’t work if parent is collapsed?
Hello lenaykt
Yes there is a method to go to the next page.
It is explained in the API documentation.goToNextPage Method
Navigates to a next page when pageable is set to true.Code example
Invoke the goToNextPage method.
$(“#treeGrid”).jqxTreeGrid(‘goToNextPage’);
If you need to track the current page, although there is no method to get the current page, you can track the pageChanged and store the current page (default would be the 0 – first page). Here is an example of how to get the new page on pageChanged event.
Regarding your second question, here is an example of getView taking the sub element of a parent, you will notice it works the same even if the parent is collapsed/expanded.
Best Regards,
VladimirjQWidgets Team
http://www.jqwidgets.com/Hi Vladimir, thanks for your fast reply. I ll play with the pageChanged event. Hope it works.
About getView method. I use it in the exact same way as you showed. But I have 3 checkboxes(red,blue,green). I use them to apply filters. If I check or uncheck one of the checkboxes event fires and my grid is filtered. For example, If red button is checked and 2 another not then I filter my grid by rows at least with one red cell. So, when I want to jump from one item to another with filters applied with getview I still I get an unfiltered list of all nested items if parent is collapsed. Referring to fiddle example: http://jsfiddle.net/ryxbE/22/ If you apply filter and then try to getView if parent is collapsed you still see unfiltered list. Is there some solution to this?
Hello lenaykt
The API page says:
Returns an array of all rows loaded into jqxTreeGrid. The method takes into account the applied Filtering and Sorting.
So this behavior is correct.
Edit: I will need to check in with my collegues tomorrow regarding if the behavior of filtered collapsed data is correct.
Best Regards,
VladimirjQWidgets Team
http://www.jqwidgets.com/Hi Vladimir, thanks.
If the “getView” behavior is correct than I search by checkboxes states not taking into account filtering.
One more question about filtering… I use also ‘simple’ filtering mode. I want to search in all columns except first which has collapsing/expanding elements. Is it possible? Because, now it returns values found in all columns. And if behavior of getView is correct how can I check that filtering in the ‘Search’ field is applied and get a search value? Otherwise my navigation will get lost again.
Regards,
lenayktthere is no method to get the current page
I think it is not possible to implement what I want… you have also a multiple selection… If I select more that one element getSelection chooses the first one. Actually, I want something like “go to page with selected element”. Is it possible to get selected element position on the page or page number of selected elements?
Hello lenaykt,
No, there is no way to select which columns to be used for simple filter.
And unfortunately I can’t think of any way to get on what page the element should be except working with the getView of unfiltered content and dividing the position of the element by the pagesize.
Regarding if a column is filtered or not, you could try to bind to the filter event and keep a custom flag for each column if it is has been filtered and remove it when it is no longer filtered.I am sorry that I can not provide a better solution.
Best Regards,
VladimirjQWidgets Team
http://www.jqwidgets.com/Hello Vladimir,
Oh, its oke. I am thinking to disable paging and switch to one page mode then. But I have a big grid ~3-5K. I read data from json file. And number of columns is always different. It can grow may be until 100-150. If I apply a Virtual mode on demand and sort of an accordion behavior will it be an appropriate solution?
Hello lenaykt,
I honestly can’t say. You will have to try it for yourself.
Best Regards,
VladimirjQWidgets Team
http://www.jqwidgets.com/Oke) thanks, Vladimir. I’ve disabled paging. At the moment, it looks good. Though, again one question arises… How can I find an element in the selected row? For example, traverse ‘a’ tags in the row. I saw that in jqxTree you can use a “find” method: $(elem.element).find(‘a’).trigger(‘click’); I want to have a button which will simulate movement from one cell to another in the selected row and trigger an ‘a’ tag click event. As I know you can’t select cell in jqxTreeGrid…
-
AuthorPosts
You must be logged in to reply to this topic.