2013-02-27 24 views
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結構。如何將xml子節點映射到jqgrid

我的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應該是什麼?

回答

0

可以使用row:"ProtoRequest>LineItem"xmlReader內,並按照my answer在你前面的問題:使用xmlmap定義功能。要讀取RequestorProtoRequest可以使用jQurey.parent方法裏面的xmlmap函數。