<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: jqGrid error in Portal environment - Need Help to resolve</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-error-in-portal-environment-need-help-to-resolve</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-error-in-portal-environment-need-help-to-resolve/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>arvindcbe on jqGrid error in Portal environment - Need Help to resolve</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-error-in-portal-environment-need-help-to-resolve#p25606</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-error-in-portal-environment-need-help-to-resolve#p25606</guid>
        	        	<description><![CDATA[<p>Need help in resolving the following error:</p>
<p>Implementing spring portlet mvc + jquery + jqgrid to pull data from database and display it in the jqGrid table.</p>
<p>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.</p>
<p>&#160;ERROR:</p>
<p>ub.extend.readyjquery-1.4.4.min.js:29(anonymous function)</p>
<p>jquery.portlet-1.0.js:92mThis.ready (<strong>mcg</strong>.<strong>js</strong>:7)</p>
<p>Uncaught TypeError: Object #&#60;Object&#62; has no method &#39;jqGrid&#39;</p>
</p>
<p>My JSP will look like :</p>
<p>&#60;%@ page contentType="text/html" isELIgnored="false" %&#62;&#160;</p>
<p>&#60;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&#62;</p>
<p>&#60;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %&#62;</p>
<p>&#60;%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %&#62;</p>
<p>&#60;%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %&#62;</p>
<p>&#60;%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %&#62;&#60;%@ include file="/WEB-INF/jsp/include.jsp" %&#62;</p>
<p>&#160;&#60;portlet:defineObjects/&#62;</p>
<p>&#60;div id="&#60;portlet:namespace /&#62;_main"&#62;</p>
<p>&#60;!-- Import all the jquery &#38; jqGrid resources --&#62;</p>
<p>&#60;script type="text/javascript" src="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jqgrid/grid.locale-en.js") %&#62;" &#62;&#60;/script&#62;</p>
<p>&#60;script type="text/javascript" src="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jqgrid/jquery.jqGrid.min.js") %&#62;" &#62;&#60;/script&#62;</p>
<p>&#60;script type="text/javascript" src="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jquery/jquery-1.4.4.min.js") %&#62;" &#62;&#60;/script&#62;</p>
<p>&#60;script type="text/javascript" src="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jquery/jquery-ui-1.8.6.custom.min.js") %&#62;" &#62;&#60;/script&#62;</p>
<p>&#60;script type="text/javascript" src="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/jquery-portlet/jquery.portlet-1.0.js") %&#62;" &#62;&#60;/script&#62;</p>
<p>&#60;!-- CSS --&#62;</p>
<p>&#60;link rel="stylesheet" type="text/css" media="screen" href="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/css/jqgrid/ui.jqgrid.css")%&#62;"  &#62;&#60;/link&#62;</p>
<p>&#60;link rel="stylesheet" type="text/css" media="screen" href="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/css/jquery/ui-lightness/jquery-ui-1.8.16.custom.css")%&#62;"  &#62;&#60;/link&#62;</p>
<p>&#60;/div&#62;</p>
</p>
<p>&#60;div id="&#60;portlet:namespace /&#62;_content"&#62;</p>
<p>&#60;table id="rosterGrid" &#62;&#60;/table&#62;</p>
<p>&#60;div id="roster"&#62;&#60;/div&#62;</p>
<p>&#60;/div&#62;</p>
</p>
<p>&#60;script type="text/javascript" src="&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/resources/js/mcguire/mcg.js") %&#62;" &#62;&#60;/script&#62;</p>
</p>
<p>My js file mcg.js which contains the jqGrid code will look like:</p>
<p>mcg.js</p>
<p>&#160; &#160; &#160; &#160;<strong>var</strong> McGuirePortlet = <strong>function</strong>(nameSpace) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>var</strong> mThis = $.Portlet.call(<strong>this</strong>, nameSpace);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mThis.ready = <strong>function</strong>() {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // this method is called when $(document).ready is called</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; alert("Coming here");</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#rosterGrid").jqGrid({</p>
<p>url:&#39;&#60;%=renderResponse.encodeURL(renderRequest.getContextPath() + "/roster/grid")%&#62;&#39;,&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: "json",</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[&#39;Last Name&#39;, &#39;First Name&#39;],</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel:[</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;lastName&#39;,index:&#39;firstName asc&#39;, width:55},</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;firstName&#39;,index:&#39;firstName&#39;, width:55}&#160;&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum:10,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList:[10,20,30],</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: &#39;#roster&#39;,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;lastName&#39;,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: <strong>true</strong>,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: "desc",</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption:"JSON Roster Grid"</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; jQuery("#rosterGrid").jqGrid(&#39;navGrid&#39;,&#39;#roster&#39;,{edit:<strong>false</strong>,add:<strong>false</strong>,del:<strong>false</strong>});</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>return</strong> mThis;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160; jQuery.registerPortlet(<strong>new</strong> McGuirePortlet("&#60;portlet:namespace /&#62;"));</p>
]]></description>
        	        	<pubDate>Thu, 05 Jan 2012 18:52:20 +0200</pubDate>
        </item>
</channel>
</rss>