alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 361 forks source link

Alphabet Pagination #148

Closed blpraveen closed 10 years ago

blpraveen commented 10 years ago

I have a glossary items which I need to list in Alphabetical order. How can I do this?

drouillard commented 10 years ago

@blpraveen sorting works by default. If you click on the header of a column it will sort

E.G. http://codepen.io/drouillard/pen/dthvA

JangoSteve commented 10 years ago

@drouillard I think he may be talking about paginating by letter instead of by a fixed number of records per page. Like having the pagination be "A, B, C, etc." instead of "1, 2, 3, etc.".

If that's the case, then the two places you'd want to look at in the code would be the paginate function, which decides which records to show currently, the page bounds function, and the paginationLinks constructor, which decides which links to append to the table to page through the records.

But there's a lot of functionality intertwined with sorting, pushState, selecting pages programatically via the paginationPage and paginationPerPage constructors, etc. I'm thinking you're probably better off turning pagination off via features.pagination = false, and then doing your own slicing/link appending.

blpraveen commented 10 years ago

Hi Steve, I tried paginate false and use listnav along with dynatable. it is not working properly. What I need was alphabetical pagination with search

I have attached complete files

On Fri, Sep 12, 2014 at 2:30 AM, Steve Schwartz notifications@github.com wrote:

@drouillard https://github.com/drouillard I think he may be talking about paginating by letter instead of by a fixed number of records per page. Like having the pagination be "A, B, C, etc." instead of "1, 2, 3, etc.".

If that's the case, then the two places you'd want to look at in the code would be the paginate function https://github.com/alfajango/jquery-dynatable/blob/faa29fb361c779287259d23a8ae2da350ea538bc/jquery.dynatable.js#L650-L654, which decides which records to show currently, the page bounds function https://github.com/alfajango/jquery-dynatable/blob/faa29fb361c779287259d23a8ae2da350ea538bc/jquery.dynatable.js#L660-L665, and the paginationLinks constructor https://github.com/alfajango/jquery-dynatable/blob/faa29fb361c779287259d23a8ae2da350ea538bc/jquery.dynatable.js#L1363-L1465, which decides which links to append to the table to page through the records.

But there's a lot of functionality intertwined with sorting, pushState, selecting pages programatically via the paginationPage and paginationPerPage constructors, etc. I'm thinking you're probably better off turning pagination off via features.pagination = false, and then doing your own slicing/link appending.

— Reply to this email directly or view it on GitHub https://github.com/alfajango/jquery-dynatable/issues/148#issuecomment-55328081 .

Thank You, B L Praveen

Like, Follow, & B L Praveen on Facebook https://www.facebook.com/bl.praveen22 | Twitter http://twitter.com/blpraveen/| Linkein https://www.linkedin.com/in/blpraveen

[IMAGE]Confidentiality Notice: The information contained in this e-mail and any attachments may be legally privileged and confidential. If you are not the intended recipient, you are notified that any distribution or copying of this e-mail is prohibited. If you have received this in error, please notify me and permanently delete the e-mail and any attachments. You should not retain, copy or use this e-mail or any attachment, nor disclose the contents to any other person. Thank you