jahanzaib  kk
jahanzaib kk

Reputation: 688

Displaying popup on Click on jtable cell

I am displaying data in jquery UI jtbale using asp.net MVC 4. I am facing problem in displaying a new view on click of cell of jtable. What i want is that when jtable load the data i have an extra column name load and when i click on that column a popup should display the a new view containing the baisc information of that patient .Below i am sharing the images for jtable.

Image of my jtable enter image description here

is it possible

Upvotes: 1

Views: 1315

Answers (1)

Matt Bodily
Matt Bodily

Reputation: 6423

use an ajax call in your jquery

$.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
    }
});

and on your controller have an method

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

see here for more information for getting table row id on button click (can be link also, just use a selector) jQuery: Get the contents of a table row with a button click

Upvotes: 1

Related Questions