ShieldUi datagrid如果只有一个数据集结果显示'no data to display'

ShieldUi datagrid shows 'no data to display' if there is only a single data set result

我正在使用shieldui的网格显示一些数据。如果只有一个数据节点,table 呈现并显示 'There is no data to display'。如果有两个或更多结果,则显示正常。这是我用来显示数据的代码 -

$('.data-holder').shieldGrid({
    dataSource: {
         data: jsonFromXML.HistoricalQuotes.HistoricalQuote
    }
});

像下面这样的多节点 xml 显示得很好 -

<IRXML CorpMasterID="xxxxx">
  <HistoricalQuotes Ticker="xxx" Date="03/03/1992">
    <HistoricalQuote>
      <Bid>0</Bid>
      <Ask>0</Ask>
      <High>28.1643892082794</High>
      <Low>27.7277320112518</Low>
      <Volume>583524.1048</Volume>
      <Open>27.8368963105087</Open>
      <SharesOutstanding>0</SharesOutstanding>
      <Last>28.1643892082794</Last>
      <AdjustmentFactor>1.145063</AdjustmentFactor>
      <RollingEarnings>0</RollingEarnings>
      <ShortInterest>0</ShortInterest>
    </HistoricalQuote>
    <HistoricalQuote>
      <Bid>0</Bid>
      <Ask>0</Ask>
      <High>28.1643892082794</High>
      <Low>27.7277320112518</Low>
      <Volume>583524.1048</Volume>
      <Open>27.8368963105087</Open>
      <SharesOutstanding>0</SharesOutstanding>
      <Last>28.1643892082794</Last>
      <AdjustmentFactor>1.145063</AdjustmentFactor>
      <RollingEarnings>0</RollingEarnings>
      <ShortInterest>0</ShortInterest>
    </HistoricalQuote>
  </HistoricalQuotes>
</IRXML>

但是如果我像这样返回单个数据节点,我会得到 'no records to display message' -

<IRXML CorpMasterID="xxxxx">
  <HistoricalQuotes Ticker="xxx" Date="03/03/1992">
    <HistoricalQuote>
      <Bid>0</Bid>
      <Ask>0</Ask>
      <High>28.1643892082794</High>
      <Low>27.7277320112518</Low>
      <Volume>583524.1048</Volume>
      <Open>27.8368963105087</Open>
      <SharesOutstanding>0</SharesOutstanding>
      <Last>28.1643892082794</Last>
      <AdjustmentFactor>1.145063</AdjustmentFactor>
      <RollingEarnings>0</RollingEarnings>
      <ShortInterest>0</ShortInterest>
    </HistoricalQuote>
  </HistoricalQuotes>
</IRXML>

我通读了找到的文档,没有发现任何关于此的限制。有人对此有什么想法吗?

非常感谢任何意见。

我试图重现所描述的问题,但无济于事。在我这边,将网格绑定到单个对象显示它,但没有 "no records to display message"。我的设置是:

    var products = [{
        ProductID: 1,
        ProductName: "Chai",
        SupplierID: 1,
        CategoryID: 1,
        QuantityPerUnit: "10 boxes x 20 bags",
        UnitPrice: 18.0000,
        UnitsInStock: 39,
        UnitsOnOrder: 0,
        ReorderLevel: 10,
        Discontinued: false
    }];

$("#grid1").shieldGrid({
            dataSource: {
                data: products
            },
            columns: [
            { field: "ProductName", title: "ProductName", width: "330px" },
            { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "130px" },
            { field: "UnitsInStock", title: "Units In Stock", width: "130px" },
            { field: "Discontinued", width: "130px" }
            ]
        });

你的设置是什么?你也可以确认 jsonFromXML.HistoricalQuotes.HistoricalQuote 包含一条记录吗?另请注意,此记录需要像我的示例一样位于 json 数组中。你能确认当 xml 包含一条记录时 jsonFromXML.HistoricalQuotes.HistoricalQuote 中的对象被包裹在一个数组中吗?

此致, 吉