Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在表格中以角度显示单个对象的数据时出现问题_Javascript_Angular_Typescript_Kendo Ui_Angular7 - Fatal编程技术网

Javascript 在表格中以角度显示单个对象的数据时出现问题

Javascript 在表格中以角度显示单个对象的数据时出现问题,javascript,angular,typescript,kendo-ui,angular7,Javascript,Angular,Typescript,Kendo Ui,Angular7,我有一个角函数,如: memberDtos=[]; getDataOfDtoCache(cacheData:any,nameOfCache:String){ console.log(nameOfCache); this.hasTableClicked=true; this.memberDtos.push(cacheData); this.tableName=nameOfCache; con

我有一个角函数,如:

 memberDtos=[];

    getDataOfDtoCache(cacheData:any,nameOfCache:String){
        console.log(nameOfCache);
        this.hasTableClicked=true;
           this.memberDtos.push(cacheData);
            this.tableName=nameOfCache;
         console.log(this.memberDtos);
      }
在执行console.log(this.memberDtos)时;我得到一个对象,如下所示:

GBIM: false
GBI: false
NCHL_T: false
NCHLST: false
NIB_Q: false
NIBL_S: false
P_RQ: false
PES: false
SQ: false
SBL_RES: false
STLME_REQ: false
STL_IME_RES: false
STLIBL_REQ: false
SN_RES: false
STRVU_REQ: false
SU_RES: false
S_REQ: false
STL_RES: false
我希望这个对象以如下形式出现在表中:

但在html部分,我使用KendoUI作为:

   <kendo-grid 
              [kendoGridBinding]="memberDtos" 

              [resizable]="true"
              [filterable]="true"
              [groupable]="true"
              [sortable]="true"
              [pageable]="{
                buttonCount:4,
                pageSizes:[5,10,15]
                }"
              [pageSize]="5"
              *ngIf="hasTableClicked && tableName=='Member DTO'"   >

                  <kendo-grid-column field="memberId" title="Bo Id" width="70">
                  </kendo-grid-column>
                  <kendo-grid-column field="memberCode" title="Client Dealer Id" width="100s">
                  </kendo-grid-column>

              </kendo-grid>

但在我的UI中,我在单行中获得了全部数据,如下所示:


它只是给我显示了一行。我希望整个数据都在不同的行中。我能得到它吗?

kendoGridBinding
将数据作为(可编辑的)对象数组接受。您需要将数据转换为
key:value
对象数组,以便能够在图像的不同列中显示值

下面是它应该是什么样子的

使用
for in
循环遍历输入数据,并将数据作为
{key:value}