首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何将xml子节点映射到jqgrid

如何将xml子节点映射到jqgrid
EN

Stack Overflow用户
提问于 2013-02-27 15:15:35
回答 1查看 191关注 0票数 0
代码语言:javascript
复制
<ProtoRequest
        No = "84P6-11-00023"
        Requestor = "Daniel Frank(E677648)"
        CustomerName = "TLV BMW"
        CustomerOrder = ""
        MWO = "4601302"
        PartNumber = ""
        ProductType = ""
        CreationDate = "24-Jun-2011"
        ABCClasification = ""
        ProtoStatus = "Closed"
        UsageType = "Component Request"
        BOMAvailabilityDate = ""
        BOMCommitedDate = ""
        Technology = ""
        Plant = "84P6-Thaon Les Vosges"
        EstimatedBudget_USD = "0.00">
        <LineItem
            PartNumber = "805069-009A"
            Description = "Hsg-Comp retouche"
            RequestQty = "1"
            Supplier = ""
            RequestedDeliveryDate = "29-Jun-2011"
            LineStatus = "Closed"
            SalesOrder = "1654130"
            Item = "10"
            StandardLeadTime = "23"
            ABCClassification = "-1"
            AgreedDate = ""
            EstimatedCost_USD = "0.0"/>
        <LineItem
            PartNumber = "811352-006A"
            Description = "hsg comp retouche"
            RequestQty = "1"
            Supplier = ""
            RequestedDeliveryDate = "28-Jun-2011"
            LineStatus = "Partially Closed"
            SalesOrder = "1654130"
            Item = "20"
            StandardLeadTime = "23"
            ABCClassification = "-1"
            AgreedDate = ""
            EstimatedCost_USD = "0.0"/>
        <LineItem
            PartNumber = "811352-006A"
            Description = "Hsg-Comp retouche"
            RequestQty = "1"
            Supplier = ""
            RequestedDeliveryDate = "28-Jun-2011"
            LineStatus = "Partially Closed"
            SalesOrder = "1654130"
            Item = "20"
            StandardLeadTime = "23"
            ABCClassification = "-1"
            AgreedDate = ""
            EstimatedCost_USD = "0.0"/>
    </ProtoRequest>

上面是我想映射到jqGrid的xml结构。

我的xmlReader是:

代码语言:javascript
复制
xmlReader: { 
     root:"ProtoRequestInfo",
     row:"ProtoRequest",
     repeatitems:false
      }

现在我需要4个(否"LineItemNo“标签)要在主网格本身而不是子网格中使用此信息创建的行。

预期输出:

代码语言:javascript
复制
No              Requestor               PartNumber     Description
____________________________________________________________________________
84P6-11-00023   Daniel Frank(E677648)   805069-009A    Hsg-Comp retouche
84P6-11-00023   Daniel Frank(E677648)   811352-006A    hsg comp retouche
...........
...........

colmodel应该是怎样的?

EN

回答 1

Stack Overflow用户

发布于 2013-02-27 15:47:41

您可以在xmlReader中使用row:"ProtoRequest>LineItem",并遵循上一个问题的my answer:使用定义为函数的xmlmap。要读取ProtoRequestRequestor,可以在xmlmap函数内部使用jQuery.parent方法。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15106221

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档