Note that there are some explanatory texts on larger screens.

plurals
  1. POJQGrid + ASP.NET MVC 3 Redirect to record details on doubleclick
    primarykey
    data
    text
    <p>I have implemented a simple jqGrid in my ASP.NET MVC 3 application. It shows the data correctly, so that's fine. But now I want my application to show the details of a row if I doubleclick on a row. I have a Detail action method that actually gets called with the correct ID, the details are retrieved from database and the Details view is returned, so that seems to be OK, but in my application nothing happens.</p> <p>I have the following script for the grid:</p> <pre><code>jQuery(document).ready(function () { jQuery("#list").jqGrid({ url: '/Incident/ListData/', datatype: 'json', mtype: 'GET', colNames: ['TicketNumber', 'Title', 'CreatedOn'], colModel: [ { name: 'TicketNumber', index: 'TicketNumber', width: 75, align: 'left' }, { name: 'Title', index: 'Title', width: 250, align: 'left' }, { name: 'CreatedOn', index: 'CreatedOn', width: 90, align: 'left'}], pager: jQuery('#pager'), rowNum: 10, rowList: [10, 50, 100], sortname: 'CreatedOn', sortorder: "desc", viewrecords: true, width: 650, imgpath: '/Content/themes/base/images', caption: 'Incidents', ondblClickRow: function (id) { $.get('/Incident/Detail/' + id); } }); }); </code></pre> <p>I've tried using $.ajax instead of $.get, but in both cases the details method gets called and nothing happens.</p> <p>This is the Details action method</p> <pre><code> public ViewResult Detail(Guid id) { var query = from inc in _repository.Incidents where inc.Id == id select new IncidentModel(inc) { CreatedOn = inc.CreatedOn, Description = inc.Description, ModifiedOn = inc.ModifiedOn, TicketNumber = inc.TicketNumber, Title = inc.Title, Status = inc.Status }; var incident = query.FirstOrDefault(); return View(incident); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload