@model RazorApp.ViewModels.SearchAlbumViewModel
@{
Layout = "";
}
<script type="text/javascript">
$(document).ready(function () {
$("#storeManagerResults").jqGrid({
url: '@Url.Action("DoAlbumSearch", Model)',
datatype: 'json',
mtype: 'POST',
emptyrecords: "No results",
colNames: ['Genre', 'Artist', 'Title', 'Price'],
colModel: [
{ name: "Genre", width: 100, editable: false, searchoptions: {}, index: "Genre" },
{ name: "Artist", width: 300, editable: false, searchoptions: {}, index: "Artist" },
{ name: "Title", width: 350, editable: false, searchoptions: {}, index: "Title" },
{ name: "Price", width: 75, editable: false, searchoptions: {}, index: "Price" }
],
pager: $('#storeManagerPager'),
rowList: [10, 20, 30], // disable page size dropdown
pgbuttons: true, // disable page control like next, back button
viewrecords: true, // disable current view record text like 'View 1-10 of 100'
sortname: 'Genre',
sortorder: 'asc',
loadonce: false,
sortable: true,
scrollrows: true,
height: 500,
hoverrows: false
});
$("#storeManagerResults").jqGrid('navGrid', '#storeManagerPager', {
edit: true, editfunc: function () {
var id = $("#storeManagerResults").jqGrid('getGridParam','selrow');
$('#albumEdit').load ("@Url.Action("EditAlbum")" + "/" + id);
$("#albumEditDialog").dialog("open"); return false; },
add: true, addfunc: function () {
$('#albumEdit').load ("@Url.Action("CreateAlbum")");
$("#albumEditDialog").dialog("open"); return false; },
del: true, delfunc: function () {
var id = $("#storeManagerResults").jqGrid('getGridParam','selrow');
$('#albumEdit').load ("@Url.Action("DeleteAlbum")" + "/" + id);
$("#albumEditDialog").dialog("open"); return false; },
search: false
});
});
</script>
<table id="storeManagerResults">
</table>
<div id="storeManagerPager">
</div>