I have updated the WebAssist reoder code to make it easier as I am updating a significant number of files and wanted to reduce the headache. Be warned. This has not undergone extensive testing, but it is WAY easier than before.
Here are the files: reorderDA2.class.zip
FILE UPDATED 3/19/2013.
- The code was checking for whether the query was sorted by the sort colum but not adding it to the query. Fixed
FILE UPDATED 3/31/2013.
- If you set the rows to show more records and the page number value became invalid, and error would be thrown. Now it steps back one page at a time until it finds the correct page to display. Fixed
The instructions are similar to the original post HERE, so I will make this brief.
- Follow the first step and include the file only the current name is reorderDA2.class.php
- Next, and this is where it gets easier, just include the following below the WADA Databridge recordset.
Now the parameters are just the text portion of the connection variable and the table name.
If your cannection variable is $connReorder, the first parameter is "connReorder".
Also include the sort column name if it is not sortorder.
Lastly you can include an array for the choices on how many records to display, so it looks like this:
connection (string), table name (string), sort column name (string), display # records (array) - Next follow the step for inserting the head code, and that is it.
- If you are using the current version of WADADB, your're done, but if you are using a custom form, or you are adding this to an old form, you need to follow the step to adjust the table.
I've tested this against the old and new forms. I'm using the WebAssist=>Database=>DataAssist Pages gui to generate the pages, so if you're making custom forms and it doesn't work, please let me know, though I may not do anything about it, if it is easy, I will. I'm basically generating the pages using this GUI with no template and then adding the template (or theme) afterwards. This is designed for site backend use, so custom page structures are generally not needed.
If it works for you the way it is working for me, this method adds all thepage elements you need and even adds the sort column to the query if you forgot to add it since it is generally not displayed. Updating some of my ADDT and older WADA pages just got easier!.
Hope this helps.
Steven