Forum


20:40

27/07/2009

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
04:30

Moderators
30/10/2007

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.
15:07

27/07/2009

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
01:18

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66