I have set up a table to reorganize content based on custom weight field. Everything works well without pager.
But if I add a pager to the form, only the items displayed will be reorganized - causing conflicts with items in other pages. Why drupal_add_tabledrag doesn't consider only the weight values that are in the current page. This would avoid any item in current page to take the same value as an item in another page.
The Taxonomy Core module do it perfectly. For example in the form where you can reorganize terms, there is a pager (admin/structure/taxonomy/[vocabulary]):
In Taxonomy form, when there are several pages, the last item of a page will appear in in first in next page (so user can drag & drop either against next items or/and previous items)
How can I do the same in a custom form?
/**** EDIT ****/
Due to @Aneek Mukhopadhyay answer, I updated my post.
Actually the issue is not related with pager, but drupal_add_tabledrag(). The pager is working well.
The drag & drop feature too. The problem is that when reorganizing content in a page, some items will take a weight value already used by another item (in another page).
For example here is the first page of my form (before dragging any item):
And the second page:
If I move the item "Test 11" for example, new weight value for the item "Test 2" will be 2:
And the weight value 2 is already used by item Test 1 (in second page)
To achieve that I used drupal_add_tabledrag() this way:
drupal_add_tabledrag($table_id, 'order', 'sibling', 'example-item-weight');
I tried several options with drupal_add_tabledrag() but didn't find any other way to make it working without issues.
I also checked the taxonomy module but cannot figure out how they work with drupal_add_tabledrag().