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_Related Related Topics sp_TopicIcon
XML element attribute
20/04/2010
21:16
Avatar
Energetic Pixels
Lexington, OK, USA
Member
Members
Forum Posts: 40
Member Since:
12/04/2010
sp_UserOfflineSmall Offline

DEAD ISSUE for the moment... NEEd to solve just getting data into grid first.

I have an xml document which uses the xml element attritubute, such as the "dodic" in the following example:

<chemical dodic="k866″>
    <weaponType>smoke</weaponType>
</chemical>

I am trying to set up my jqGrid to be able to use element attributes, either in the xmlReader or colModel portion of the script.  Looking through the documentation, I don't see an example of how it is accomplished.  I am using static xml document as my data source.  If I need to restructure the xml to move this attribute into its own element, I would like to do it now.

Does anyone have a suggestion??

Here is my controller script:

$('#chem li').click(function() {
        $('#welcome').css('display', 'none');
        $('#searchResults').jqGrid({
            url: 'weaponLib/AME_chem.xml',
            datatype: 'xml',
            colNames:["DODIC","NSN", "Nomenclature"],
               colModel:[
                   {name:"dodic",index:"dodic", width:120, xmlmap:"ItemAttributes>Author"},
                   {name:"NSN",index:"NSN", width:180,xmlmap:"chemical>transData>NSN"},
                   {name:"nomenclature",index:"nomenclature", width:100, align:"right",xmlmap:"chemical>nomenclature", sorttype:"float"}
                ],
            height:250,
            width: 700,
            rowNum:10,
            rowList:[10,20,30],
            viewrecords: true,
            loadonce: true,
            xmlReader: {
                    root : "chemicals",
                    row: "chemical",
                    repeatitems: false,
                    id: "ASIN"
                },
            caption: "Chemical Weapon Results"
        });
        
        $('#theGrid').css('display', 'block');
        
    });

Tony

26/04/2010
12:58
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Did you have read:

XML Notes and Limitations

in the docs here:

http://www.trirand.com/jqgridw.....imitations

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:
12 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