Forum


04:27

03/07/2009

I have two different xmlstring as source for grid.Depending upon some codition I want to replace the previously assigned xmlstring source with new xmlstring source. I tried .trigger("reloadGrid") but it does not show the grid with new data.What I should do to replace the old source with new source and vice-versa.
Thanks
23:35

03/07/2009

I have the same problem here is a sample of my code:
datatype: 'xmlstring',
datastr : item_17_xml,
...
});
Then on another jquery object, when a an event happen i have this:
var item_17_xml = get_node("xml/main.xml",NODE.id);
jQuery("#item_17").clearGridData() ;
jQuery("#item_17").trigger("reloadGrid");
The clearGridData does work but the reloadGrid doesnt work.
23:57

03/07/2009

This should re-load the grid with new source:
<script language=javascript>
LoadData = function() {
var mygrid = $("#list")[0];
sXML = "<rows><row><cell>data1</cell><cell>data2</cell></row></rows>"
if
(!mygrid.grid) {
jQuery("#list").jqGrid({datatype: 'xmlstring',datastr: sXML,width: 400,colNames: ['cell 1', 'cell 2'],colModel: [{ name: 'cell1', index: 'cell1', width: 75 },{ name: 'cell1', index: 'cell2', width: 190}],pager: jQuery('#pager'),rowNum: 10,rowList: [10, 50, 100], viewrecords: true,imgpath: 'themes/basic/images',caption: 'My first grid'}).navGrid('#pager', { add: true, edit: true, del: true});}
else
{ sXML = "<rows><row><cell>new data1</cell><cell>new data2</cell></row></rows>"
$("#list").setGridParam({ datatype: 'xmlstring', datastr: sXML }).trigger("reloadGrid"
);}}</script>
</head>
<body>
<table id="list" class="scroll" width=200></table><div id="pager" class="scroll" style="text-align:center;" width=200></div><div id="pagernav" class="scroll" style="text-align:center;"></div><input type=button onclick="LoadData()" value="Load Grid" /><input type=button onclick="LoadData()" value="Re-Load Grid" /></body></html>
12:39

03/07/2009

It now work for me, i used your sample senthill 😛
i changed this:
jQuery(”#item_17″).trigger(”reloadGrid”);
to this:
jQuery("#item_17").setGridParam({ datatype: 'xmlstring', datastr: item_17_xml }).trigger("reloadGrid");
I would like to help you but i started learning jquery a week ago so i have no idea if what you are doing can be done. 🙁
Most Users Ever Online: 715
Currently Online:
138 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