I have created a custom component, that use backend listings (extends from JModelList). Exactly like the core joomla com_content, my extension store a list of items.
My items are chapters of a documentation imported books (a lot of books and chapters), the structure is like:
Code: Select all
0. Book title
1 title
1.1 title
1.2 title
.... More than 5000 records.
All is fine... Until one book as been modified by its author, and have new chapters.
Now in the backend listing. I added a button to each line named 'insert child article'. This button il like the 'new' button, except it pass 2 custom values in the url to prefill the parent_id field, and the current ordering.
All is fine, I can create child item.
BUT, now my problem is the ordering. I want that the new inserted item, goes not at end of listing (ordering = getMaxOrder()..), but to the next ordering number just after the line from where I created this child.
Sample:
Code: Select all
23.4 Title abc (ordering 3456) [insert child]
23.5 Title xyz (ordering 3457) [insert child]
Is there an easy way to do this with the joomla api?
I hope it's clear to understand ...
Thanks you, Cédric