如何在没有刷新页面的情况下在表中对MVC进行排序? [英] how to do sorting in MVC in tables without refreshing page?

查看:52
本文介绍了如何在没有刷新页面的情况下在表中对MVC进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向我展示一些我可以在我的项目中使用的示例详情



Show me some examples that i can use in my project with details

function Sorting(columnName, cityId, tabid) {
    if (sort == "ASC") {
        sort = "DESC";
    } else {
        sort = "ASC";
    }
    $.ajax({
        type: "GET",
        contentType: 'application/json',
        url: "/VisitorList/Sorting",
        data: {
            Id: currentPage,
            cityId: cityId,
            searchType: tabid,
            columnName: columnName,
            sortType: sort
        },
        success: function (data) {
            $('#divVisitorsList').html(data);
            sort = data.Sort_Direction;
        }
    });
}

$('.sorting').click(function (evt) {
    var columnName = $(this).text();
    var cityId = $('#ddlLocation').val();
    var tabid = $(".VisitorActiveTab").find('.active').attr('id');
    Sorting(columnName, cityId, tabid)
});

推荐答案

.ajax({
类型: GET
contentType:' application / json'
url: / VisitorList / Sorting
数据:{
Id:currentPage,
cityId:cityId,
searchType:tabid,
columnName:columnName,
sortType: sort
},
成功: function (data){
.ajax({ type: "GET", contentType: 'application/json', url: "/VisitorList/Sorting", data: { Id: currentPage, cityId: cityId, searchType: tabid, columnName: columnName, sortType: sort }, success: function (data) {


' #divVisitorsList')。html(data);
sort = data.Sort_Direction;
}
});
}
('#divVisitorsList').html(data); sort = data.Sort_Direction; } }); }


' 。sorting') .click( function (evt){
var columnName =
('.sorting').click(function (evt) { var columnName =


这篇关于如何在没有刷新页面的情况下在表中对MVC进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆