Thanks for the quick response! After the ajax call, if I refresh the page, both lists should actually show the new order. The ajax call is:
Code:
$.ajax({
url: "/main_scripts/sort_chapters_and_sections.php",
type: "POST",
data: newOrder,
success: function(thing_reordered){
//here I'll print something
}
The php script which gets called is:
PHP Code:
if (isset($_POST['section'])) {
$new_order = "";
foreach ($_POST['section'] as $order =>$book_section_id) {
$data['book_order'] = $order+1;
$where['book_section_id = ?'] = $book_section_id;
$updated = $dbWrite->update('book_topics',$data,$where);
}
require_once('../main_scripts/cache_setup_for_headers.php');
$nav_left_cache->remove('nav_left_cache');
}
After I refresh the page, the 'nav_left_cache' gets successfully repopulated with the new order (there's a separate script which populates that area if there's nothing in the cache. However, another list doesn't get refreshed even though it's dynamically generated from my database.
Bookmarks