Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Tbody paging and sorting #961

Closed
dileephb opened this issue Jul 9, 2015 · 5 comments
Closed

Multiple Tbody paging and sorting #961

dileephb opened this issue Jul 9, 2015 · 5 comments
Labels

Comments

@dileephb
Copy link

dileephb commented Jul 9, 2015

Hi Motie,

I am still unable to find a solution for multiple tbody paging. I have three groups in my grid. Under each group I have 10 to 15 records. When I sort, the records in each group should be sorted. This works great.
Also I want to achieve pagination across all 3 groups. This does not work correctly because I have each group as a tbody and paging works for the first tbody only.I have looked into many examples and I could not achieve it. You had mentioned that this should be eacsy to achieve, can yu please help.

I am not doing any ajaz operation meaning, I am fetching my records from server and adding it to my view and then calling table sorter plugin. Please let me know if you need more information from me.

@Mottie
Copy link
Owner

Mottie commented Jul 10, 2015

Hi @dileephb!

Are you saying you're not doing any ajax operations? So all the rows exist within the table and you want to add pagination to all tbodies?

@dileephb
Copy link
Author

Mottie,

Thats right. I have a basic mvc view populated with all the rows. I would like to display these rows among 4 different groups. So I used multiple Tbody to display each group. The sorting works fine across all the groups but pagination doesn't work.

@dileephb
Copy link
Author

Mottie,

Can you please let me know if there is any solution to this. I started usinf table sorter for my grid purpose and now I am not able to meet this requirement. Your help will be greatly appreciated.

@Mottie
Copy link
Owner

Mottie commented Jul 13, 2015

I started working on a demo for you this morning, then I found some issues:

In a table with the pager applied to multiple tbodies:

  • How do you count total rows? I think counting by page would be the solution, but just in case the output were to include a row count, it wouldn't make sense, or would only make sense for the last tbody.
  • How do you count filtered rows?
  • What if each tbody has a different number of rows, what do you do when the page is beyond that tbody? Show nothing? Stay on the last page? Everything would get unsynchronized if you use that approach.
  • How would you differentiate each row count? Would each tbody need a spacer with a custom output?

Then I thought, maybe I could just add multiple tables, all controlled by one pager:

  • First off, the pager is not set up to allow multiple bindings to the same set of controls. So, I added event namespace bindings to fix that (not yet pushed to the master branch, but it may be unnecessary at this point).
  • The same problem with counting rows shows up again. What if each table had a different number of rows? Would you show an empty tbody? If the fixedHeight option were set, a nice big empty gap would show up in that empty table.

So, I'm starting to think that maybe the best solution would be to have multiple tables, each with their own pager.

I am open to feedback on how to implement your idea. What are you expecting as a result?

@Mottie
Copy link
Owner

Mottie commented Jul 28, 2015

Since I don't see how this change would be useful or really even usable. I'm going to close this issue.

You should be able to use one set of pager controls to work on multiple tables. I just don't think it's a good idea unless all tables have the same number or rows.

@Mottie Mottie closed this as completed Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants