Forum


22:23

05/01/2009

HI All,
I am a newbie to javascript as i am to Jquery/Jgrid..
Trying to setup and run a Jrgid Multitool bar search.
Tried the example as given in http://trirand.com/jqgrid/jqgrid.html ->New in version 3.3 ->MultiTool bar Search.
I have a jsp that calls another servlet that actually talks to DB to pass the infromation for loading the Grid..
Copied the script "as is" from the website.. but result is as below..
It gives me the following error - "gridimgpath is not defined"..
Even without the code, only on including the follwing, it gives me the error..
<
script src="${pageContext.request.contextPath}/search1.js" type="text/javascript"></script>
Help is greately appreciated.
Thanks,
Navtaj
00:40

05/01/2009

Hi, Thanks for responding.. below is what i have .. i think i already tried your suggestion please have a look..
<html xmlns=http://www.w3.org/1999/xhtml>
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Insert title here</title><link rel="stylesheet" type="text/css" media="screen" href="${pageContext.request.contextPath}/themes/basic/grid.css" /><link rel="stylesheet" type="text/css" media="screen" href="${pageContext.request.contextPath}/themes/jqModal.css" /><script src="${pageContext.request.contextPath}/jquery.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/jquery.jqGrid.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/search1.js" type="text/javascript"></script>
<
script src="${pageContext.request.contextPath}/js/jqModal.js" type="text/javascript"></script>
<
script src="${pageContext.request.contextPath}/js/jqDnR.js" type="text/javascript"></script>
<
script type="text/javascript">
// We use a document ready jquery function.
var gridimgpath="/themes/sand/images"
;
</script></head>
And themes is just under Web-Content.
Please let me know what is missing...
01:42

05/01/2009

Ok!!.. i got rid of the error message that was earlier being observed..
Now.. i see a blank page loaded with no errors ..
I made the following changes to the search1.js.. and added the following
in the jsp..apart from the earlier includes of jquery scripts...
<
body><table id="s1list" class="scroll" cellpadding="0" cellspacing="0"></table><div id="s1pager" class="scroll" style="text-align:center;"></div></body>
Note : I do not need date picker at the moment , so have removed it..
var gridimgpath="/themes/sand/images";
jQuery("#s1list").jqGrid({
url:'${pageContext.request.contextPath}/testServlet',
datatype: "xml",
colNames:['ID','NAME', 'STATUS', 'CHANNEL','VERSION'],
colModel:[
{name:'id',index:'id', width:65},
{name:'name',index:'name', width:100},
{name:'status',index:'status', width:80, align:"right"},
{name:'channel',index:'channel', width:80,align:"right"},
{name:'version',index:'version', width:150, sortable:false}
],
rowNum:10,
mtype: "POST",
rowList:[10,20,30],
imgpath: gridimgpath,
pager: jQuery('#s1pager'),
sortname: 'id',
viewrecords: true,
toolbar : [true,"top"],
sortorder: "desc",
caption:"Multiple Toolbar Search Example"
});
jQuery("#t_s1list").height(25).hide().filterGrid("s1list",{gridModel:true,gridToolbar:true});
jQuery("#s1list").navGrid('#s1pager',{edit:false,add:false,del:false,search:false,refresh:false})
.navButtonAdd("#s1pager",{caption:"Search",title:"Toggle Search",buttonimg:gridimgpath+'/find.gif',
onClickButton:function(){
if(jQuery("#t_s1list").css("display")=="none") {
jQuery("#t_s1list").css("display","");
} else {
jQuery("#t_s1list").css("display","none");
}
}
});
Most Users Ever Online: 715
Currently Online:
84 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66