具有分组和展开折叠的AngularJS表

时间:2018-11-28 14:39:22

标签: angular grouping ng-grid

我对AngularJS还是很陌生,我一直尝试遵循在stackoverflow上可以找到的尽可能多的示例,但是由于某些原因,我似乎并没有使它正常工作。

我正在尝试显示一个在特定字段上分组的Angular ng-grid,并且行必须可扩展,并且前面必须带有“ +”或“-”符号。

从AJAX调用返回的数据如下:

 [{
    "isoip":"10.0.0.1",
    "send":"SEND1",
    "aggr":"ICT",
    "tld":"<img width='15' src ='flags\/United States.png'> <strong>EXAMPLE.COM<\/STRONG>",
    "ptr":"server1.example.com",
    "date_report_begin":"2018-11-09",
    "total":"5000",
    "dkdom":null,
    "spdom":"example.com",
    "dkres":"<font color='red'>ERROR<\/font>",
    "spres":"<font color='blue'>SUCCESS<\/font>",
    "from":"johnson.example.com",
    "pol":"q",
    "reason":null
},
{
    "isoip":"10.0.0.2",
    "send":"SEND1",
    "aggr":"ICT",
    "tld":"<img width='15' src ='flags\/United States.png'> <strong>EXAMPLE.COM<\/STRONG>",
    "ptr":"server2.example.com",
    "date_report_begin":"2018-11-09",
    "total":"5000",
    "dkdom":null,
    "spdom":"example.com",
    "dkres":"<font color='red'>ERROR<\/font>",
    "spres":"<font color='blue'>SUCCESS<\/font>",
    "from":"johnson.example.com",
    "pol":"q",
    "reason":null
},
{
    "isoip":"10.0.0.8",
    "send":"SEND2",
    "aggr":"ICT",
    "tld":"<img width='15' src ='flags\/United States.png'> <strong>EXAMPLE.COM<\/STRONG>",
    "ptr":"server8.example.com",
    "date_report_begin":"2018-11-09",
    "total":"5000",
    "dkdom":null,
    "spdom":"example.com",
    "dkres":"<font color='red'>ERROR<\/font>",
    "spres":"<font color='blue'>SUCCESS<\/font>",
    "from":"johnson.example.com",
    "pol":"q",
    "reason":null
},
]

我需要在Angular表中对此进行显示,并在“发送”字段上进行分组。 因此,在上述情况下,我将有2个表行,其中一个用于send = send1,它将包含2个子记录,而一个用于send = send2,它将包含1个子记录。

0 个答案:

没有答案