有没有办法在ng2-smart-table的单个表单元格中显示对象列表?我已尝试创建renderComponent,但得到的值为空值。另一个问题是,过滤和排序仍然适用于此吗?



发布于 2018-11-15 11:40:03
据我所知,您有一个对象,并且希望在ng2-smart-table中显示该数据。
要做到这一点,请执行以下步骤。
import { LocalDataSource } from 'ng2-smart-table';
source : any = LocalDataSource;当你调用API时,你必须在源中设置该数据。
this.apiService.POST({}, 'getProductList').subscribe((res) => {
console.log(res);
this.source = new LocalDataSource(res.data); // Set response as per your res.
});

如你所见,我还设置了一个数组,该数组有数据对象,我在表中设置了。
我希望这能对你有所帮助。:)
https://stackoverflow.com/questions/53295966
复制相似问题