【HTML代码】
foreach ($categorys as $category):?>
name?>
endforeach;?>
else: ?>
endif; ?>
【js代码】
require(["jquery","jqueryui"],function($) {
var d = window.top.dialog({
content: '配置已更新'
});
$(function() {
$( ".list-group").sortable({
stop: function( event,ui ) {
data = '';
$('li.list-group-item').each(function (){
data += ',' + $(this).attr('data-id');
});
$.post('/group/category/listorder',{data:data});
d.show();
setTimeout(function () {
d.close();
},1000);
}
}).disableSelection();
});
});
【PHP代码】
PHP;">
input->post('data'));
$i = 1;
foreach ($data as $id) {
if (!$id)
continue;
$this->category_model->save($id,array(
'listorder' => $i,));
$i++;
}
}
public function delete() {
$id = $this->input->get('id');
$this->category_model->delete($id);
messageBox(lang('success'),'referer');
}