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

Sorting And Pagination together on tables #400

Closed
BhuvanaSanthoshkumar opened this issue Dec 30, 2015 · 11 comments
Closed

Sorting And Pagination together on tables #400

BhuvanaSanthoshkumar opened this issue Dec 30, 2015 · 11 comments

Comments

@BhuvanaSanthoshkumar
Copy link

Still there is no support on pagination and sorting on tables? I implemented Pagination but sorting not working properly

@Voxis
Copy link

Voxis commented May 4, 2016

Here is my two cents:
I can actually do sorting and pagination together... Here is the link
A JSFiddle Example
It uses another directive called "dirPagination" from AngularUtils & updated AngularJS version to 1.4.8
Modified the base code from angular xeditable's table row edit.

The problem I have is that, the edit mode does not "close" when the item being edited goes to another page.

Scenario 1:

Edit and second Item (User 2) and click on the Name sorting link at the top of the table.
You can see that User 8 is in edit mode now.

Scenario 2:
Delete items until it only have 5 , and do the Scenario 1.
If the item being edited is still in the page. the edit mode does not follow

Maybe it is also caused by some other libraries. so i dont know.

My question is: is there a scope flag in the library so it tells you there are some items in edit mode.
So that at least I can check this flag to prevent sorting.

@atodicebear
Copy link

Hey,
did you found a solution for Edit with Pagination?
Iam using as well dirPagination and the Problem is Editing something in Page1 then changing to Page 2 it delete/forgets the Changes.
Somehow to remember it?

  1. Dirty just to call save allways after changing Pages
  2. Just remember Changes

@atodicebear
Copy link

@ckosloski
Something you are working on wiht Pagination or how to Save the Edited Fields while Changing the Page with Pagination?

@ckosloski
Copy link
Contributor

No, not currently working on that. Pull requests are welcome :)

@atodicebear
Copy link

@ckosloski
How can I read the Values of the generated TextFields?
Because you use you "e-name.." and so on and not "ng-model".
Because I want to read from every TextField the Data and save them allways onLeaveOfTextField or PageChange in a Factory. If user wants to save then it gets the Data from the Factory.
Is there something implemented as "ng-change" as in Normal Textareas?
https://docs.angularjs.org/api/ng/directive/textarea
This could be helpfull

@ckosloski
Copy link
Contributor

I think what you need to do is to submit the form on page change so that it saves the values.
If you don't want to save the values, maybe you could try adding an onchange event to keep track of all the values and then save them manually.
Also, maybe inspect the editable form object (i.e. rowform). I think it contains an array of the items on the form ($editables). Not sure if it has anything useful or not.

@atodicebear
Copy link

I tried with "save on page change" but it didnt do the Trick.
The Values were deleted faster as the save came.
This on Change is what I want to do now.
With normal Textareas its working through ng-model+ng-change.
But your Editable Textareas dont accept neither ng-model or ng-change.
That was the question If it has something implemented like "ng-change/e-change?"

@ckosloski
Copy link
Contributor

You can add e-ng-change to a textarea.

@ckosloski
Copy link
Contributor

@atodicebear are you still having issues?

@atodicebear
Copy link

@ckosloski
If i remember correctly I did a workaround with a Factory Method which just saved the Values with e-ng-change and after saving/cancel just delete everything to clear the Factory.

But Im not anymore a Member of this Project so for further Questions or Codesnippets I cant help anymore, sorry.

@ckosloski
Copy link
Contributor

@eugef I think this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants