Forum


11:31

30/01/2011

hi,
how do you insert search's toolbar in my Grid? I read the documentation but doesn't work..:(
help:D thanks
this is my code:
$(document).ready(function()
{
jQuery("#list19").jqGrid
({
url: 'ranking.xml',
datatype: "xml",
colNames:["Squadra","Giocate","Vinte","Perse","Pareggiate","Gol fatti","Gol Subiti","Diff.reti","Punti"],
colModel :[
{name:'squadra', index:'team', width:100, xmlmap:"squadra"},
{name:'giocate', index:'plays', width:100, xmlmap:"giocate"},
{name:'vinte', index:'win', width:100, xmlmap:"vinte"},
{name:'perse', index:'lost', width:100, xmlmap:"perse"},
{name:'pareggiate', index:'tie', width:100, xmlmap:"pareggiate"},
{name:'gol_x0020_fatti', index:'gfatti', width:100, xmlmap:"gol_x0020_fatti"},
{name:'gol_x0020_subiti', index:'gsubiti', width:100, xmlmap:"gol_x0020_subiti"},
{name:'differenza_x0020_reti', index:'diffreti', width:100, xmlmap:"differenza_x0020_reti"},
{name:'punti', index:'pnt', width:100, xmlmap:"punti"}
],
height:100,
rowNum:10,
rowList:[10,20,30],
pager: '#pagernav',
viewrecords: true,
loadonce: true,
xmlReader: {
root : "NewDataSet",
row: "Table",
repeatitems: false,
id: "squadra"
},
sortorder: "punti",
caption:'Classifica'
});
14:58

10/08/2009

You should insert call of the function filterToolbar after the definition of the grid. For example
Best regards
Oleg
16:43

30/01/2011

mmm..:
1) I Download jqgrid with Grid base(jqGrid) and Custom(Additinal methods).
2) I write this code:
<head>
<title>jQuery Hello World Alert box</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/ui-lightness/jquery-ui-1.8.9.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-it.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<table id="list19"></table>
<div id="gridpager"></div>
</head>
<script type="text/javascript">
$(document).ready(function()
{
jQuery("#list19").jqGrid
({
url: 'ranking.xml',
datatype: "xml",
colNames:["Squadra","Giocate","Vinte","Perse","Pareggiate","Gol fatti","Gol Subiti","Diff.reti","Punti"],
colModel :[
{name:'squadra', index:'team', width:100, search:true, xmlmap:"squadra"},
{name:'giocate', index:'plays', width:100, xmlmap:"giocate"},
{name:'vinte', index:'win', width:100, xmlmap:"vinte"},
{name:'perse', index:'lost', width:100, xmlmap:"perse"},
{name:'pareggiate', index:'tie', width:100, xmlmap:"pareggiate"},
{name:'gol_x0020_fatti', index:'gfatti', width:100, xmlmap:"gol_x0020_fatti"},
{name:'gol_x0020_subiti', index:'gsubiti', width:100, xmlmap:"gol_x0020_subiti"},
{name:'differenza_x0020_reti', index:'diffreti', width:100, xmlmap:"differenza_x0020_reti"},
{name:'punti', index:'pnt', width:100, xmlmap:"punti"}
],
height:100,
rowNum:10,
rowList:[10,20,30],
pager : '#gridpager',
viewrecords: true,
loadonce: true,
xmlReader: {
root : "NewDataSet",
row: "Table",
repeatitems: false,
id: "squadra"
},
sortorder: "punti",
caption:'Classifica'
});
jQuery("#list19").jqGrid('filterToolbar', {stringResult: true, searchOnEnter: false, defaultSearch:"cn"});
});
</script>
<body>
<br>
<br>
</body>
</html>
3) The output is: lineguides.netsons.org/myproject3/LaStanza.html
The toolbar search is visible but doesn't work, try it..
some files must be configured with the fields of research?
thank you very much;)
21:17

10/08/2009

The main error in your code was that you used very strange index column properties. You code has also many small errors. Compare your version with the fixed version and you will see what I mean.
Best regards
Oleg
23:33

30/01/2011

thanks;) works!! http://lineguides.netsons.org/.....tanza.html
Most Users Ever Online: 715
Currently Online:
51 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