Search the Community
Showing results for tags 'natsort'.
-
Hi guys, I'm running into a few issues trying to use my sorting dropdown on a table to play nicely with digits in a string. My table currently has a total as one of its columns and I have created a select dropdown to choose the sorting method: <form action="./" method="post"> <select name="sort" onchange="form.submit()"> <option value="title">Sort by...</option> <option value="title">Invoice number A-Z</option> <option value="-title">Invoice number Z-A</option> <option value="invoice_total">Invoice Total A-Z</option> <option value="-invoice_total">Invoice Total Z-A</option> <option value="invoice_status">Invoice Status A-Z</option> <option value="-invoice_status">Invoice Status Z-A</option> <option value="invoice_client">Client Name A-Z</option> <option value="-invoice_client">Client Name Z-A</option> <option value="invoice_date">Invoice Date A-Z</option> <option value="-invoice_date">Invoice Date Z-A</option> </select> </form> <?php foreach ($page->children("sort={$input->post->sort}") as $invoice) { ?> I've just realised that it will struggle to sort my invoice_total as I believe it may need natsort() applying to it. The problem is when I try this, it seems to completely empty the pageArray. Could anyone give me a pointer? Thanks