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
No luck with xmlstring..
26/07/2009
20:40
Avatar
descsuit
Member
Members
Forum Posts: 16
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

I've been trying for two days to get a simple example of an xmlstring based jqGrid working.. it displays the headers and a border but no content.. here's the code I've trimmed down to..

var facetString = "<?xml version='1.0' encoding='UTF-8'?>\\
<cluster id='CL-1'>\\
    <name>Bubba</name>\\
    <shortName>Bub</shortName>\\
    <facets>\\
        <facet macro='0' micro='0' id='F-0'>\\
            <studentFeedback>You got it.</studentFeedback>\\
            <description>He gets it, sorta</description>\\
        </facet>\\
    </facets>\\
</cluster>";
           
            $("#facet-table").jqGrid({
                datatype : "xmlstring",
                datastr : facetString,
                xmlReader : {
                    root : "facets",
                    row : "facet"
                },
                multiselect : true,
                multiboxonly : true,
                autowidth : true,
                colNames : ["Code", "Description"],
                colModel : [
                    {name : "code", index : "code", align: "center", sortable: false, width : 50, resizable: false, xmlmap: "[macro]"},
                    {name : "description", sortable: false, width : 900}
                ],
                imgpath : "javascript/third-party/jquery-ui-custom/css/south-street/images",
                viewrecords : true,
                caption: "<strong>Facets</strong>"
            });

I have about 18 other questions, but I figured once I got the basic going.. (for instance what config fields are required?, How do you make a column the concatenation of two attributes? IE macro+micro.. Is it ok to not have a pager?, etc..)

Descsuit

27/07/2009
04:30
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

To test. In 3.5 version we have a string to doc function (which convert xml string to dom element)

Just do this in firebug

console.log(jQuery.stringToDoc(facetString));

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.

27/07/2009
15:07
Avatar
descsuit
Member
Members
Forum Posts: 16
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

I saw that function when running through the source.  It seemed to work fine. I have tweaked the xml since to include those empty fields, etc.. so I could check again..

BTW, is there a difference between $.stringToDoc and jQuery.stringToDoc ?  I tried $.stringToDoc and it said it was not found so I just copied the method into my code and called it to see that it worked.

Alan

28/07/2009
14:35
Avatar
descsuit
Member
Members
Forum Posts: 16
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

OK I checked with that exact code and the copy of stringToDoc (still not sure why it isn't accessible) and it worked fine (showed Document in the log).

I just formatted the jqGrid.min and I'll try to see a little closer where things are going awry.

Alan

28/07/2009
15:26
Avatar
descsuit
Member
Members
Forum Posts: 16
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

OK after stepping through the constructor.. I realized that I had to set repeatItems in the xmlreader to false, then it started to partially work.. but [macro] is not getting the attribute to fill that first column.. hrmm..

Alan

29/07/2009
01:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

As of the docs you can not get data from attribute. The only exception is id.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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