Forum


00:42

27/06/2008

jQuery("#list19").jqGrid({
url: 'http://127.0.0.1:13310/stat/ta.....s',
datatype: "xml",
colNames:["TASK_ID","START_TIME", "END_TIME", "ENABLE","DESC","STATUS"],
colModel:[
{name:"TASK_ID",index:"ID", width:80, xmlmap:"TASK_ID"},
{name:"TASK_START_TIME",index:"START_TIME",
width:180,align:"right",xmlmap:"TASK_START_TIME",sorttype:"date"},
{name:"TASK_END_TIME",index:"END_TIME", width:180, align:"right",xmlmap:"TASK_END_TIME",
sorttype:"date"},
{name:"TASK_ENABLE",index:"ENABLE", width:130,xmlmap:"TASK_ENABLE"},
{name:"TASK_DESC",index:"DESC", width:100, xmlmap:"TASK_DESC"},
{name:"TASK_STATUS",index:"STATUS", width:100, xmlmap:"TASK_STATUS"}
],
height:250,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
viewrecords: true,
loadonce: true,
xmlReader: {
root : "TaskList",
row: "Task",
repeatitems: false,
id: "TASK_ID"
},
caption: "TASK LIST"
});
I can GET the XML file from "http://127.0.0.1:13310/stat/tasks" and show it in the xml in IE,but why i can't get the xml using the code above and put it into grid?
03:25

Moderators
30/10/2007

Check your xmlReader configuration again.
You can use inlineedit or formedit modules depending on your need - refer to docs and demos
You can get the grid data using the methods
getDataIDs - to grab all the ids of the grid - and then use
getRowData method to get the contents and put this in format what you want.
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.
21:19

27/06/2008

I have a web server set up and running on my machine, and I can post an XML document to the server
and process the response from the server(which are also another XML document).
I enter the address as "server ip:13310/stat/tasks", minus the quotes,and 13310 is the porter number.
then I can get the XML data in browser.
but When I use the "jqgrid",I can't perform the XML data to the grid with the following code.
================================================================================================
jQuery("#list19").jqGrid({
url: 'http://127.0.0.1:13310/stat/ta.....s',
datatype: "xml",
colNames:["TASK_ID","START_TIME", "END_TIME", "ENABLE","DESC","STATUS"],
colModel:[
{name:"TASK_ID",index:"ID", width:80, xmlmap:"TASK_ID"},
{name:"TASK_START_TIME",index:"START_TIME", width:180,align:"right",xmlmap:"TASK_START_TIME",sorttype:"date"},
{name:"TASK_END_TIME",index:"END_TIME", width:180, align:"right",xmlmap:"TASK_END_TIME", sorttype:"date"},
{name:"TASK_ENABLE",index:"ENABLE", width:130,xmlmap:"TASK_ENABLE"},
{name:"TASK_DESC",index:"DESC", width:100, xmlmap:"TASK_DESC"},
{name:"TASK_STATUS",index:"STATUS", width:100, xmlmap:"TASK_STATUS"}
],
height:250,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
viewrecords: true,
loadonce: true,
xmlReader: {
root : "TaskList",
row: "Task",
repeatitems: false,
id: "TASK_ID"
},
caption: "TASK LIST"
});
============================================================================================================
but I put the XML document on my own localdisk,the program work well,the code like this.
===============================================================================================================
jQuery("#list19").jqGrid({
url: 'tasks.xml',
datatype: "xml",
colNames:["TASK_ID","START_TIME", "END_TIME", "ENABLE","DESC","STATUS"],
colModel:[
{name:"TASK_ID",index:"ID", width:80, xmlmap:"TASK_ID"},
{name:"TASK_START_TIME",index:"START_TIME", width:180,align:"right",xmlmap:"TASK_START_TIME",sorttype:"date"},
{name:"TASK_END_TIME",index:"END_TIME", width:180, align:"right",xmlmap:"TASK_END_TIME", sorttype:"date"},
{name:"TASK_ENABLE",index:"ENABLE", width:130,xmlmap:"TASK_ENABLE"},
{name:"TASK_DESC",index:"DESC", width:100, xmlmap:"TASK_DESC"},
{name:"TASK_STATUS",index:"STATUS", width:100, xmlmap:"TASK_STATUS"}
],
height:250,
rowNum:10,
rowList:[10,20,30],
imgpath: gridimgpath,
viewrecords: true,
loadonce: true,
xmlReader: {
root : "TaskList",
row: "Task",
repeatitems: false,
id: "TASK_ID"
},
caption: "TASK LIST"
});
Most Users Ever Online: 715
Currently Online:
39 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