Forum
23:33
27/06/2008
my code:
jQuery("#list2").jqGrid({
url: 'xObjectList_s.php',
datatype: "xml",
colNames:["OBJ_ID","OBJ_NAME", "HAS_VALUE", "OBJ_DESC"],
...........
and the xObjectList_s.php 's response like this :
<?xml version="1.0" standalone="yes"?>
<ObjectList>
<Object>
<OBJ_ID>4</OBJ_ID>
<OBJ_NAME>INT</OBJ_NAME>
<HAS_VALUE>false</HAS_VALUE>
<OBJ_DESC>TelInfo</OBJ_DESC>
</Object>
<Object>
<OBJ_ID>5</OBJ_ID>
<OBJ_NAME>TE</OBJ_NAME>
<HAS_VALUE>false</HAS_VALUE>
<OBJ_DESC>TelDia</OBJ_DESC>
</Object>
</ObjectList>
how can i put this response into jqgrid.
i can't construct the jqgrid from the response above,
dose response have the specified format ?
04:00
27/06/2008
Hi ,tony:
Do I have to conform the data from server side to the fixed format
<?xml version='1.0' encoding='utf-8'?>
<rows><page></page><total>2</total><records>13</records><userdata name='tamount'>3820.00</userdata>
<userdata name='ttax'>462.00</userdata><userdata name='ttotal'>4284.00</userdata><row id='13'><cell>13
</cell><cell>2007-10-06</cell><cell><![CDATA[Client 3]]></cell><cell>1000.00</cell><cell>0.00</cell>
<cell>1000.00</cell><cell><![CDATA[]]></cell></row><row id='12'><cell>12</cell><cell>2007-10-06</cell
><cell><![CDATA[Client 2]].............................
andxml data must have "<rows><page>......." ?
05:58
Moderators
30/10/2007
You should configure xmlReader when the data is not in the format that is descibed into the docs.
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.
06:26
27/06/2008
jQuery("#list1").jqGrid({
datatype: 'xmlstring',
datastr : str,
colNames:["TaskId","START_TIME", "END_TIME", "ENABLE","DESC","STATUS"],
colModel:[
{name:"TASK_ID",index:"TASK_ID", width:50, xmlmap:"TASK_ID",editable:true,sorttype:"int"},
{name:"TASK_START_TIME",index:"TASK_START_TIME", width:180,align:"left",editable:true,xmlmap:"TASK_START_TIME",sorttype:"date"},
{name:"TASK_END_TIME",index:"TASK_END_TIME", width:180, align:"left",editable:true,xmlmap:"TASK_END_TIME", sorttype:"date"},
{name:"TASK_ENABLE",index:"TASK_ENABLE", width:60,editable:true,xmlmap:"TASK_ENABLE",edittype:"select",editoptions:{value:"ENABLE:true;DISABLE:false"}},
{name:"TASK_DESC",index:"TASK_DESC", width:140,editable:true,xmlmap:"TASK_DESC"},
{name:"TASK_STATUS",index:"TASK_STATUS", width:40,editable:true,xmlmap:"TASK_STATUS"}
],
height:250,
rowNum:10,
pager: jQuery('#pagered'),
rowList:[10,20,30],
editurl:"postTaskList.php" ,
imgpath: gridimgpath,
viewrecords: true,
loadonce: true,
xmlReader: {
root : "TaskList",
row: "Task",
repeatitems: false,
id: "TASK_ID",
},
caption: "TASK LIST",
--------------------------------------------------------------
<TaskList>
<Task>
<TASK_ID>1</TASK_ID>
<TASK_START_TIME>2007-01-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-10-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>false</TASK_ENABLE>
<TASK_DESC>test</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
<Task>
<TASK_ID>5</TASK_ID>
<TASK_ENABLE>false</TASK_ENABLE>
<TASK_DESC>æ¯æ—¥ç»Ÿè®¡</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
<Task>
<TASK_ID>6</TASK_ID>
<TASK_START_TIME>2007-07-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-07-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>true</TASK_ENABLE>
<TASK_DESC>分时段统计全局åŠå‘è¯</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
<Task>
<TASK_ID>7</TASK_ID>
<TASK_START_TIME>2007-07-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-09-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>true</TASK_ENABLE>
<TASK_DESC>A disabled valid task for test</TASK_DESC>
</Task>
<Task>
<TASK_ID>8</TASK_ID>
<TASK_ENABLE>false</TASK_ENABLE>
</Task>
<Task>
<TASK_ID>9</TASK_ID>
</Task>
<Task>
<TASK_ID>10</TASK_ID>
</Task>
<Task>
<TASK_ID>11</TASK_ID>
</Task>
<Task>
<TASK_ID>12</TASK_ID>
</Task>
<Task>
<TASK_ID>13</TASK_ID>
</Task>
</TaskList>
------------------------------
Why can't work?
Thx a lot.
09:53
Moderators
30/10/2007
Try to eclose the string in single quotes, not in double something like
var mystr = '<TaskList>
<Task>
<TASK_ID>1</TASK_ID>
<TASK_START_TIME>2007-01-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-10-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>false</TASK_ENABLE>
<TASK_DESC>test</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
...
</TaskList>'
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.
02:06
27/06/2008
Hi,tony:
Mystring is not a defined variable, but acquired by response data in xxxxx.php. So there is no double or single quotation mark.
I tried to use url:xxxxx.php, but it can not form grid neither. Is it a problem of character coding about response data in xxxxx.php?
I changed the characters in response data into utf-8 format, but it also doesn’t work.
Thx a lot !
10:57
Moderators
30/10/2007
I reccomend you to use FireBug and see the request from the server
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.
19:27
27/06/2008
Would you tell me what the request are used for ?
I have use FireBug,and when i get the url, the response from the server like this :
<TaskList>
<Task>
<TASK_ID>1</TASK_ID>
<TASK_START_TIME>2007-01-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-10-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>false</TASK_ENABLE>
<TASK_DESC>test</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
<Task>
<TASK_ID>5</TASK_ID>
<TASK_ENABLE>false</TASK_ENABLE>
<TASK_DESC>æ¯æ—¥ç»Ÿè®¡</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
<Task>
<TASK_ID>6</TASK_ID>
<TASK_START_TIME>2007-07-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-07-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>true</TASK_ENABLE>
<TASK_DESC>分时段统计全局åŠå‘è¯</TASK_DESC>
<TASK_STATUS>1</TASK_STATUS>
</Task>
<Task>
<TASK_ID>7</TASK_ID>
<TASK_START_TIME>2007-07-01T00:00:00+08:00</TASK_START_TIME>
<TASK_END_TIME>2008-09-01T00:00:00+08:00</TASK_END_TIME>
<TASK_ENABLE>true</TASK_ENABLE>
<TASK_DESC>A disabled valid task for test</TASK_DESC>
</Task>
<Task>
<TASK_ID>8</TASK_ID>
<TASK_ENABLE>false</TASK_ENABLE>
</Task>
<Task>
<TASK_ID>9</TASK_ID>
</Task>
<Task>
<TASK_ID>10</TASK_ID>
</Task>
<Task>
<TASK_ID>11</TASK_ID>
</Task>
<Task>
<TASK_ID>12</TASK_ID>
</Task>
<Task>
<TASK_ID>13</TASK_ID>
</Task>
</TaskList>
In this data,there are some Chinese characters in it.
I'm not sure the reason why i can't display is because of the
Chinese characters.But why it can display when I use the
url:â€xxx.xmlâ€,after I saved the
response as “xxx.xml†on my local computer.I'm sure
the xmlreader is right.
02:51
Moderators
30/10/2007
If possible please send me a link to the problem. You can send me e-mail
to: tony at trirand dot com
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:
25 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