Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Why i can't GET the xml from URL
30/06/2008
00:42
Avatar
murdoc
Member
Members
Forum Posts: 23
Member Since:
27/06/2008
sp_UserOfflineSmall Offline

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?

30/06/2008
01:34
Avatar
murdoc
Member
Members
Forum Posts: 23
Member Since:
27/06/2008
sp_UserOfflineSmall Offline

And i  want to set my grid editable.  how can i make

the xml sting  from the grid  ,and how to  post it to a URL.

regards

          murdoc

30/06/2008
03:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

30/06/2008
09:52
Avatar
Reg
Calgary, Canada
Member
Members
Forum Posts: 92
Member Since:
06/06/2008
sp_UserOfflineSmall Offline

Hi Murdoc,

If you are still having problems with reading your data, could you show us a portion of your xml file, please?

Reg

02/07/2008
21:19
Avatar
murdoc
Member
Members
Forum Posts: 23
Member Since:
27/06/2008
sp_UserOfflineSmall Offline

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"

});


Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
31 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information