Forum


17:28

25/02/2009

1. jQuerry version - 1.3.1
2. jqGridVersion - 3.4.1
3. OS - Windows XP SP3
4. browser - Firefox 3.0.6
5. Problem - I can't get jqGridImport to work. I tested with both testxml.xml as well as my own .xml file. Firebug shows the .xml file coming back from the request but the Grid configuration does not change.
What am I doing wrong?
6. Code and data if possible -
<script type="text/javascript">
jQuery(document).ready(function (){
jQuery("#list").jqGrid({
url:'cem_db_if.php',
colNames: ['Cemetery','County', 'First mame', 'Middle name', 'Other name(s)',
'Surname/family','Birth date','Death date'],
colModel :[
{name:'cem_name', index:'cem_name', width:200, align:'center'},
{name:'cem_county_name', index:'cem_county_name', width:100, align:'center'},
{name:'bur_fname', index:'bur_fname', width:100, align:'center' },
{name:'bur_mname', index:'bur_mname', width:100, align:'center' },
{name:'bur_maiden', index:'bur_maiden', width:100, align:'center' },
{name:'bur_sname', index:'bur_sname', width:100, align:'center'},
{name:'bur_birthdate', index:'bur_birthdate', width:100, align:'center'},
{name:'bur_deathdate', index:'bur_deathdate', width:100, align:'center'} ],
height:'auto',
pager: '#pager',
rowNum:10,
rowList:[10,20,30],
sortname: 'bur_sname',
mtype: 'POST',
postData:{table_name:"DT_Burial"},
viewrecords: true,
imgpath: 'themes/basic/images',
caption: 'TNGenWeb Cemetery Database - Burials'
}); //end grid
});//end ready
function burial() {
$("#list").jqGridImport({impurl:"testxml.xml", imptype: "xml"});
alert( $("#list").jqGridExport({exptype: "xmlstring"}) );
}//end burial
function cemetery() {
$("#list").jqGridImport({impurl:"cemetery.xml", imptype: "xml"});
alert( $("#list").jqGridExport({exptype: "xmlstring"}) );
}//end cemetery
</script>
...
<a href="javascript: void(0)" onclick="burial()">Test XML</a><br />
<a href="javascript: void(0)" onclick="cemetery()">Cemetery Table</a>
09:13

25/02/2009

OK, sorry, I had some coding issues above. I am now able to get the testxml.xml file to load. I did this by not defining the grid in the ready() but instead loading from testxml.xml to start the grid.
Is the expected behavior of jqGridImport? I thought that I could use jqGridImport to change the Grid definition. It now appears that I can only use it for the intiial loading. Is this correct?
08:08

Moderators
30/10/2007

Hello,
If you want to do that you can use GridUnload method on constructed grid and then applay again import
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:
80 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