Click here to Skip to main content
15,917,859 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i run project its gives "undefined is not a function". at myGrid.jqGrid({ this point.
please help me out
<table id="Jgrid"></table>

index.cshtml
XML
<script type="text/javascript">
        jQuery(document).ready(function () {
            var myGrid = $('#Jgrid');
            myGrid.jqGrid({ // error is here
                caption: "SubCatagory",
                url: '/api/SubCatagory',
                datatype: "json",
                contentType: "application/json; charset-utf-8",
                mtype: 'GET',
                colNames: ['SubCatagory ID', 'SubCatagory Name', 'SubCatagory Code'],
                colModel: [
                                { name: 'SubCatagoryId' },
                                { name: 'SubCatagoryName' },
                                { name: 'SubCatagoryCode' },
                ],
                rowNum: 5
            });
        });
</script>




_Layout.cshtml
link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>

    <!-- Load SCRIPT.JS which will create datepicker for input field  -->

        <meta name="viewport" content="width=device-width" />
        <link href="~/Content/jquery.jqGrid/ui.jqgrid.css" rel="stylesheet" type="text/css" />
        <link href="~/Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
       <script src="~/Scripts/i18n/grid.locale-en.js" type="text/javascript"></script>


        <script src="~/Scripts/jquery.jqGrid.min.js" type="text/javascript"></script>
Posted
Updated 23-Oct-14 3:52am
v6
Comments
[no name] 23-Oct-14 9:44am    
Dear where is the ID Jqgrid ??
fak_farrukh 23-Oct-14 9:56am    
I have updated the question write at the top
[no name] 23-Oct-14 14:10pm    
Still I am unable to find any html with Id Jgrid tag. Please verify.
Thanks
fak_farrukh 24-Oct-14 0:00am    
<table id="Jgrid"></table>
This is html Id
Kornfeld Eliyahu Peter 23-Oct-14 16:08pm    
It seems you have a problem with loading the JavaScript file of jqGrid...Please try to debug it with your browser to see any 'silent' error you may have while loading the page...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900