获取从API返回的记录总数

时间:2018-09-21 10:30:10

标签: jquery-bootgrid

我正在使用API​​获取网格的数据。 api以以下格式返回数据

{
  "current": 1,
  "rowCount": 10,
  "rows": [
    {
      "id": 19,
      "sender": "123@test.de",
      "received": "2014-05-30T22:15:00"
    },
    {
      "id": 14,
      "sender": "123@test.de",
      "received": "2014-05-30T20:15:00"
    },
    ...
  ],
  "total": 1123
}

我的问题是,当用户单击下一页或搜索或任何其他操作时,是否有可能将“总计”发送回API?基本上,我想在第一次将数据加载到网格后发送总计。

ajax: true,
post: function ()
{
    /* To accumulate custom parameter with the request object */
    return {
ReportID: "[ReportID]"
,Parameters:"[ReportParameters:Json]"
     ,RecordsPerPage:ReportOption.pageSize
     ,Key:drillThroughKey
     **,Total:{total}**
    };
}

在上面的代码中,{total}必须是第一次收到的总数。

谢谢

0 个答案:

没有答案
相关问题