question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SPAN elements in row cells are showing up empty - no data binding on rows

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior

The “table” itself will render the correct number of rows (visible by inspecting the rendered page). However, it appears that data isn’t being properly bound to the body-cell.component. .datatable-body-cell-label appears with an empty SPAN element.

<div class="datatable-body-cell-label">
    <!--template bindings={ "ng-reflect-ng-if": null }-->
    <!--template bindings={ "ng-reflect-ng-if": "true" }-->
    <span></span>
    <!--template bindings={ "ng-reflect-ng-if": null }-->
</div>

Expected behavior

Row data should be bound to the element and render to the page

Reproduction of the problem

Follow the examples in Getting Started as well as using the fetch method described in the demo.

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Mac OS 10.10.5 VS Code Webpack Angular CLI 1.0.15 Node

  • Table version: 6.0.2
  • Angular version: 2.4.5
  • Browser: all

  • Language: TypeScript 2.0.10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
avikazacommented, Apr 13, 2017

Never mind, I figured it out My columns names were in PascalCase and if I do lowercase for my row names in name value pairs there seems to be an issue matching columns to rows … an error would have saved me 4hrs but, I am just learning this component so it is alright

Thank you for a fantastic data-grid though 👍

0reactions
AksenovAndrewcommented, Apr 18, 2020

Issue is present.

When I get data from controller in PascalCase see screenshot #1 below Data display properly in code:

  <tr *ngFor="let company of page.Items">
      <td>{{company.Name }}</td>
      <td>{{company.ContactPerson}}</td>
      <td>{{company.OMSId}}</td>
      <td>{{company.Token}}</td>
  </tr>

but data doesn’t display properly in grid, see screenshot #2, in top just html table, bottom grid

<ngx-datatable class="bootstrap ngx-datatable"
               #someTable
               [rows]="page.Items"
               [loadingIndicator]="loading"
               [columns]="columns"
               [externalPaging]="true"
               [externalSorting]="true"
               [columnMode]="ColumnMode.force"
               [count]="page.TotalElements"
               [limit]="page.Size"
               [offset]="page.PageNumber"
               (page)="onPage($event)"
               (sort)="onSort($event)"
               [headerHeight]="50"
               [summaryRow]="true"
               [summaryPosition]="'bottom'"
               [footerHeight]="50"
               rowHeight="auto"
               [reorderable]="reorderable">
  <ngx-datatable-column name="Name" width="100">
    <ng-template let-value="value" ngx-datatable-cell-template>
      {{ value }}
    </ng-template>
  </ngx-datatable-column>
</ngx-datatable>

#screen 1 image

#screen 2 image

Read more comments on GitHub >

github_iconTop Results From Across the Web

asp.net - gridview column span not working - Stack Overflow
When the datatable has no rows i have written a function to bind the gridview from a separate source which adding a new...
Read more >
DataGridView Binding Problem: Rows are all empty - MSDN
I look at the Rows(index).DataBoundItem, and it is correct!!! But the Value property of each cell is Nothing and no data appears in...
Read more >
<td>: The Table Data Cell element - HTML - MDN Web Docs
This attribute contains a non-negative integer value that indicates for how many rows the cell extends. Its default value is 1 ; if...
Read more >
A Complete Guide to the Table Element | CSS-Tricks
If a table element has a rowspan attribute, it spans across two rows vertically. That means the row below it gets +1 to...
Read more >
Documentation: DevExtreme - JavaScript Data Grid Columns
Specifies whether a user can sort rows by this column at runtime. ... The data of the row to which the cell belongs....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found