var sortOrder = new Array(false, false, false);
function columnSort(event)
{
var columnIndex = $(this).prev().length;
$('table tbody').html
(
$('table tbody tr').sort(function(item1, item2)
{
if(!sortOrder[columnIndex])
{
if
(
$(item1).children('td:eq(' + columnIndex + ')').text().trim() >
$(item2).children('td:eq(' + columnIndex + ')').text().trim()
)
{return 1;}
else{return -1;}
}
else
{
if
(
$(item1).children('td:eq(' + columnIndex + ')').text().trim() <
$(item2).children('td:eq(' + columnIndex + ')').text().trim()
)
{return 1;}
else{return -1;}
}
})
);
sortOrder[columnIndex] = !sortOrder[columnIndex];
}
$(document).ready(function()
{
$('tr th').bind('click', columnSort);
});
в response код скрипта
...
switch ($_POST['action']){
case "showRegionForInsert":
echo '<select name="pod_category_id" id="pod_category_id" class="form-control">';
$ListPodCategories = Category::PodCategoriesListAll($_POST['$category_id']);
foreach ($ListPodCategories as $listCateg) {
echo '<option value="'.$listCateg['id'].'">'.$listCateg['name'].'</option>';
};
echo '</select>';
break;
...