Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
jqGrid error in Portal environment - Need Help to resolve
05/01/2012
18:52
Avatar
arvindcbe
New Member
Members
Forum Posts: 1
Member Since:
05/01/2012
sp_UserOfflineSmall Offline

Need help in resolving the following error:

Implementing spring portlet mvc + jquery + jqgrid to pull data from database and display it in the jqGrid table.

All the java script and css references are made properly but when it reads my jqgrid code it fails and throws up the below error.

 ERROR:

ub.extend.readyjquery-1.4.4.min.js:29(anonymous function)

jquery.portlet-1.0.js:92mThis.ready (mcg.js:7)

Uncaught TypeError: Object #<Object> has no method 'jqGrid'

My JSP will look like :

<%@ page contentType="text/html" isELIgnored="false" %> 

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %><%@ include file="/WEB-INF/jsp/include.jsp" %>

 <portlet:defineObjects/>

<div id="<portlet:namespace />_main">

<!-- Import all the jquery & jqGrid resources -->

<script type="text/javascript" src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jqgrid/grid.locale-en.js") %>" ></script>

<script type="text/javascript" src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jqgrid/jquery.jqGrid.min.js") %>" ></script>

<script type="text/javascript" src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jquery/jquery-1.4.4.min.js") %>" ></script>

<script type="text/javascript" src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jquery/jquery-ui-1.8.6.custom.min.js") %>" ></script>

<script type="text/javascript" src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jquery-portlet/jquery.portlet-1.0.js") %>" ></script>

<!-- CSS -->

<link rel="stylesheet" type="text/css" media="screen" href="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/css/jqgrid/ui.jqgrid.css")%>" ></link>

<link rel="stylesheet" type="text/css" media="screen" href="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/css/jquery/ui-lightness/jquery-ui-1.8.16.custom.css")%>" ></link>

</div>

<div id="<portlet:namespace />_content">

<table id="rosterGrid" ></table>

<div id="roster"></div>

</div>

<script type="text/javascript" src="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/mcguire/mcg.js") %>" ></script>

My js file mcg.js which contains the jqGrid code will look like:

mcg.js

       var McGuirePortlet = function(nameSpace) {

              var mThis = $.Portlet.call(this, nameSpace);

              mThis.ready = function() {

                     // this method is called when $(document).ready is called

                     alert("Coming here");

                     $("#rosterGrid").jqGrid({

url:'<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/roster/grid")%>', 

                           datatype: "json",

                           colNames:['Last Name', 'First Name'],

                           colModel:[

                                  {name:'lastName',index:'firstName asc', width:55},

                                  {name:'firstName',index:'firstName', width:55}  

                           ],

                           rowNum:10,

                           rowList:[10,20,30],

                           pager: '#roster',

                           sortname: 'lastName',

                           viewrecords: true,

                           sortorder: "desc",

                           caption:"JSON Roster Grid"

                     });

                     jQuery("#rosterGrid").jqGrid('navGrid','#roster',{edit:false,add:false,del:false});

              };

              return mThis;

       };

    jQuery.registerPortlet(new McGuirePortlet("<portlet:namespace />"));

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information