frtgbs07 / jquery-datatables-row-grouping

Automatically exported from code.google.com/p/jquery-datatables-row-grouping
0 stars 0 forks source link

Collapsable grouping is awkward when using paging. #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use datatable plugin with pagination.
2. use rowGrouping plugin on the above datatable.
3. collapse a group that spans many pages.

What is the expected output? What do you see instead?
the group collapses but you still have to page thru all the original pages 
event though they are empty.

What version of the product are you using? On what operating system?
1.1.6

Please provide any additional information below.

I understand that by changing the collapsed entries to display non is the 
reason it behaves this way.

I modified the plugin to not hide the rows but filter them out.  
I attached a filtering function to the datatable plugin.  It filters out the 
rows that have collapsed groups. 
I modifed the click routine to not hide the rows but invoke the table draw 
function.

These were the easy parts.

I had to modify the draw routine to figure out which groups were collapsed and 
add the proper collapsed rows.  That took a bit of doing.

I do not use it in the mode of calling a server side routine for each page.  It 
may break completely in that scenario.

I call a server side routine to bring all my rows at once and then call the 
datatable plugin sending it the json data.

Attached is the modified plugin.

Original issue reported on code.google.com by The.Bob....@gmail.com on 16 Mar 2012 at 7:28

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for this update I will try to integrate your code into the latest 
version of plugin.

Jovan

Original comment by joc...@gmail.com on 4 Apr 2012 at 8:05

GoogleCodeExporter commented 9 years ago
Hi Jovan,

       Since I posted the changed version, I have made additional changes:

            1)        Fixup resetting current page after collapsing or expanding a group.
            2)        I am not that familiar with the jQuery plugins environment.  However I noticed that if more than one table
                        on a page us using datatables and rowgrouping then the filter extension is called multiple times for the same rows.
                        I added a check and if the filter call back was already added to datatables list then do not add again.
            3)        Along with 2 I noticed that the filter function is called for every table in every context.  I added a check to the filter
                        routine to check the oSetting.nTable is the same table as oTable in the rowGrouping context. 
            4)        In the filter routine i was not getting the value of the column properly if the aData was an object as opposed to an array.

I am attaching my latest source and an html file that highlight the changes 
between my last one and this one.

Regards,
Bob Pfeffer

Original comment by The.Bob....@gmail.com on 4 Apr 2012 at 2:41

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Bob,

First thank you for your updates - sorry I have not responded earlier but I 
have integrated other changes. I hoped that I can integrate your changes with 
the other but unfortunately I failed.
The same time you sent me these updates I got few other request that have been 
in collision with yours. Currently this plugin supports two level expansion, 
effects etc and the same places in the code as in your changes are affected so 
I had to merge them somehow. 
Finally I have succeeded to integrate your parts but also to retain the old way 
(the old way is needed because it works with effects), but I got few problems: 
1. Your implementation always shows filtered 24/70 records and this is in 
collision with standard keyword search. Each time I collapse/expand group this 
information is updated.
2. Sometime, when I collapse all groups I'm getting - sorry no maching records 
found. 

I have tried to modify your changes but without success - in some DT 
configurations I even lost a groups when I have collapsed them because 
filtering has removed rows in the table and callback didn't had any rows to 
group them.

Could you take a look at the latest version of plugin and check is there 
anything I missed to integrate?

Regards,
Jovan

Original comment by joc...@gmail.com on 23 Jul 2012 at 4:51