0
<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 是:

xmlReader: { 
     root:"ProtoRequestInfo",
     row:"ProtoRequest",
     repeatitems:false
      }

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

预期输出:

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应该如何?

4

1 回答 1

0

您可以使用row:"ProtoRequest>LineItem"inside ofxmlReader并按照对上一个问题的回答:使用xmlmap定义为函数。要阅读您可以Requestor在函数内部使用jQuery.parent方法。ProtoRequestxmlmap

于 2013-02-27T07:47:40.843 回答