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
root and row not working.
17/11/2008
04:06
Avatar
guerven
New Member
Members
Forum Posts: 2
Member Since:
17/11/2008
sp_UserOfflineSmall Offline

Hi all,

   Does anybody know whats wrong with the snippet below, I;m working with XMLstring , I copied the sample from the jqgriddocs.pdf and it works fine. But when I rename the <rows> , <row> or <cell> it stops working.

I already specified the root, row, and xmlmap but to no avail.

it seems only the default datastructure is the only one that works.

<rows><row><cell>Cry</cell></row></rows>

please see code snippet below:

    <script type="text/javascript">
        var mystr = "<?xml version='1.0' encoding='utf-8'?> <myroot>  <myrow> <column1>data1</column1> <column2>data2</column2> </myrow> </myroot> ";

        jQuery(document).ready(function() {
        jQuery("#list").jqGrid({
                root: "myroot",   
                datatype: 'xmlstring',

                datastr: mystr,
                colNames: ['Inv No', 'Date'],
                colModel: [
                    { name: 'invid', index: 'invid', width: 55,  xmlmap: "column1" },
                    { name: 'invdate', index: 'invdate', width: 90, xmlmap: "column2"}],
                pager: jQuery('#pager'),
                rowNum: 10,
                viewrecords: true, repeatitems: false,
                imgpath: 'themes/basic/images',
                caption: 'My first grid'
            });
        });
    </script>

17/11/2008
04:13
Avatar
guerven
New Member
Members
Forum Posts: 2
Member Since:
17/11/2008
sp_UserOfflineSmall Offline

GOT IT!

Ah, forgive the newbie, I got it. just after posting the question.

the correct snippet is below, check the maroon colored text.

        var mystr = "<?xml version='1.0' encoding='utf-8'?> <myroot>  <myrow> <column1>data1</column1> <column2>data2</column2> </myrow> </myroot> ";
        jQuery(document).ready(function() {
        jQuery("#list").jqGrid({
                datatype: 'xmlstring',
                datastr: mystr,
                colNames: ['Inv No', 'Date'],
                colModel: [
                    { name: 'invid', index: 'invid', width: 55, xmlmap: "column1" },
                    { name: 'invdate', index: 'invdate', width: 90, xmlmap: "column2"}],
                pager: jQuery('#pager'),
                rowNum: 10,
                viewrecords: true, repeatitems: false,
                imgpath: 'themes/basic/images',
                caption: 'My first grid',
                loadonce: true,
                xmlReader: { root : "myroot", row: "myrow", repeatitems: false}
            }
);
        });

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
47 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