Search code examples
javascriptjqueryasp.netasp.net-mvcjqgrid

What are the minimum files needed to get jqGrid working with MVC?


I downloaded the files for jqGrid but I'm not quite sure what files I need to reference. So far I have these files:

<link href='@Url.Content("~/Content/themes/base/jquery-ui.css")' ... />   
<link href='@Url.Content("~/Content/themes/redmond/jquery-ui-1.8.custom.css")' ... />   
<link href='@Url.Content("~/Content/themes/redmond/ui.jqgrid.css")' ... />   
<link href='@Url.Content("~/Scripts/jquery.jqGrid-4.3.1/css/ui.jqgrid.css")' ... />              

<script src='@Url.Content("~/Scripts/jquery-1.7.1.min.js")' ...></script>   
<script src='@Url.Content("~/Scripts/jquery-ui-1.8.16.min.js")' ...></script>   

<script src='@Url.Content("~/Scripts/jquery.jqGrid-4.3.1/js/i18n/grid.locale-en.js")' ...></script>   
<script src='@Url.Content("~/Scripts/jquery.jqGrid-4.3.1/js/jquery.jqGrid.min.js")' ...></script>    

I saw another example suggesting that these were the files needed in addition to jQuery. Can someone confirm this is all that's needed and in the correct order or advise if I need to add more. For example do I need the link to the locale file?

I am just starting out learning about jqGrid. I looked around and didn't yet find a good example of how to use this with MVC3 and Razor. Does anyone have links to references that they have found very useful. Just really need one good link but most links I found with Google were old and not using Razor.


Solution

  • The minimal list of the CSS and JavaScript files which need be included you can find in the jqGrid documentation. In your case it will be

    <link href='@Url.Content("~/Content/themes/redmond/jquery-ui-1.8.custom.css")' rel='stylesheet' type='text/css' />
    <link href='@Url.Content("~/Scripts/jquery.jqGrid-4.3.1/css/ui.jqgrid.css")' rel='stylesheet' type='text/css' />
    
    <script src='@Url.Content("~/Scripts/jquery-1.7.1.min.js")' type='text/javascript'></script>
    <script src='@Url.Content("~/Scripts/jquery.jqGrid-4.3.1/js/i18n/grid.locale-en.js")' type='text/javascript'></script> 
    <script src='@Url.Content("~/Scripts/jquery.jqGrid-4.3.1/js/jquery.jqGrid.min.js")' type='text/javascript'></script>