I am trying to implement jquery in mvc, there are several tutorials on this, but I do not want jquery to have string codes (or actually everything that was hardcoded), this is the logic that should be in the controller.
So ... looking at the code below, you will see colNames: and colModel: how can I write them so that I can scroll through the model by adding a column to the table for each column element? In the end, I want the end to have a generic jqGrid statement, with the only change being the code in the / s controller!
Query("#list").jqGrid({ url: '/Home/GetMovieData/', datatype: 'json', mtype: 'GET', colNames: ['id', 'Movie Name', 'Directed By', 'Release Date', 'IMDB Rating', 'Plot', 'ImageURL'], colModel: [ **{ name: 'id', index: 'Id', width: 55, sortable: false, hidden: true }, { name: 'Movie Name', index: 'Name', width: 250 }, { name: 'Directed By', index: 'Director', width: 250, align: 'right' }, { name: 'Release Date', index: 'ReleaseDate', width: 100, align: 'right' }, { name: 'IMDB Rating', index: 'IMDBUserRating', width: 100, align: 'right' }, { name: 'Plot', index: 'Plot', width: 55, hidden: true }, { name: 'ImageURL', index: 'ImageURL', width: 55, hidden: true}],** pager: jQuery('#pager'), rowNum: 5, rowList: [5, 10, 20], sortname: 'id', sortorder: "desc", height: '100%', width: '100%', viewrecords: true, imgpath: '/Content/jqGridCss/redmond/images', caption: 'Movies from 2008' });