显示弹出窗口单击jtable单元格

时间:2013-12-16 07:47:55

标签: asp.net-mvc-4 jquery-jtable

我使用asp.net MVC 4在jquery UI jtbale中显示数据。 我在jtable的单元格上显示一个新视图时遇到问题。 我想要的是,当jtable加载数据时,我有一个额外的列名称加载,当我点击该列时,弹出窗口应显示一个包含该患者的baisc信息的新视图。我将分享jtable的图像。< / p>

我的jtable的图片    enter image description here

是否可能

1 个答案:

答案 0 :(得分:1)

在你的jquery中使用ajax调用

$.ajax({
    url: "@(Url.Action("Action", "Controller")",
    type: "POST",
    data: { id: $(this).id }
    cache: false,
    async: true,
    success: function (result) {
        $(".divContent").html(result);
        //pop up the partial view using overlay, dialog, whatever you prefer
    }
});

并且在你的控制器上有一个方法

public PartialViewResult Action(int id){
    model = //query the database 
    return PartialView("_PartialName", model);
}

请点击此处了解有关在按钮点击时获取表格行ID的更多信息(也可以链接,只需使用选择器)jQuery: Get the contents of a table row with a button click

相关问题