Forum


23:31

17/09/2008

Hi,
I am trying to implement the search option in the grid and I have not been able to make it work. The grid works fine and displays data but clicking on search button doesnt pop up the search box.
Code:
<link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="themes/jqModal.css" />
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.jqGrid.js" type="text/javascript"></script>
<script src="js/jquery.jqModal.js" type="text/javascript"></script>
<script src="js/jquery.jqDnR.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function()
{ jQuery("#list").jqGrid({
url:'dbtest.aspx',
datatype: 'xml',
mtype: 'GET',
colNames:['Advertiser','Title', 'Email','Amount','Date','SiteID'],
colModel :[ {name:'ad_username',index:'ad_username', width:55, xmlmap:'ad_username'},
{name:'title',index:'title' , width:90, xmlmap:'title'},
{name:'buy_email', index:'buy_email', width:80, align:'right', xmlmap:'buy_email'},
{name:'amount', index:'amount', width:40, align:'right', xmlmap:'amount'},
{name:'date', index:'date', width:80, align:'left', xmlmap:'date'},
{name:'siteid', index:'siteid', width:80, align:'left', xmlmap:'siteid'},],
pager: jQuery('#pager'),
rowNum:10, //rowList:[10,20,30],
//sortname: 'id',
//sortorder: "desc",
viewrecords: true,
imgpath: 'themes/basic/images',
xmlReader: {
root: "sales",
row: "sale",
page: "sales>currentpage",
total: "sales>totalpages",
records : "sales>totalrecords",
repeatitems: false,
//cell: "cell",
id: "id" //,
// subgrid: {root:"sales", row: "sale", repeatitems: true, cell:"cell"}
},
caption: 'Sales-Info',
//hiddengrid: true,
height: 509,
width: 800
});
$("#bsdata").click(function(){
jQuery("#list").searchGrid(
{sopt:['cn','bw','eq','ne','lt','gt','ew']}
);
});
//alert ('hemen')
});
</script>
</head>
<body>
<table id="list" class="scroll">
<div id="pager" class="scroll" style="text-align:center;"></div>
<input type="BUTTON" id="bsdata" value="Search" />
</body> </html>
01:24

Moderators
30/10/2007

Hello,
Sorry for this typing error in the docs. Now the right is
<script src=”js/jqModal.js” type=”text/javascript”></script>
<script src=”js/jqDnR.js” type=”text/javascript”></script>
The wrong code is:
<script src=”js/jquery.jqModal.js” type=”text/javascript”></script>
<script src=”js/jquery.jqDnR.js” type=”text/javascript”></script>
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
81 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66