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.

Can't render the table when lazily loading it's datasource

See original GitHub issue

Sorry for not following the design rules report.

If the datasource is null or empty, and fetch data in the override method OnInitializedAsync. Then the table can’t render, exception "System.NullReferenceException: “Object reference not set to an instance of an object.” in /_Host .

<Table DataSource="data2">
      <Column DataIndex="@context.id.ToString()" TData="int?" Sortable></Column>
      <Column DataIndex="@context.Vetstation.title" TData="string" Sortable></Column>
      <Column DataIndex="@context.Region.title" TData="string" Sortable></Column>
      <Column DataIndex="@context.Farm.title" TData="string" Sortable></Column>
      <Column DataIndex="@context.id_method_plan.ToString()" TData="int?" Sortable></Column>
      <Column DataIndex="@context.Animal.title" TData="string" Sortable></Column>
      <Column DataIndex="@context.date_enter.ToString()" TData="DateTime?" Format="dd-MM-yyyy" Sortable></Column>
      <Column DataIndex="@context.date_add" TData="DateTime?" Format="dd-MM-yyyy" Sortable></Column>
      <Column DataIndex="@context.amount.ToString()" TData="int?" Sortable></Column>
      <Column DataIndex="@context.id_empl.ToString()" TData="int?" Sortable></Column>
</Table>
IEnumerable<PathdataDTO> data2;
@code
{
    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();
        await InvokeAsync(StateHasChanged);
        data2 = await pathdata.GetAll();
    }
}

Further technical details

  • AntDesign Nuget Package version 0.8.0
  • The IDE: VS Community 2019

dotnet --info

Package SDK for.NET (global.json): Version: 5.0.101 Commit: d05174dc5a

Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\

Host (useful for support): Version: 5.0.1 Commit: b02e13abab

.NET SDKs installed: 5.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
anranruyecommented, Apr 25, 2021

@DJedai18 update to the latest nightly-build version(version 0.8.1,not 0.9.0), this issue is already fixed.

0reactions
ElderJamescommented, Apr 28, 2021

Please wait for the 0.8.1 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't render the treenode of Table when lazily loading it's ...
Can't render the treenode of Table when lazily loading it's datasource. If the datasource is null or empty, and fetch data in the...
Read more >
Angular 7 Can't bind to after using lazy loading
1 Answer 1 ... Since you are using Material Table, You should import MatTableModule in AppModule or in the Module where you component...
Read more >
How To Handle Async Data Loading, Lazy Loading, and ...
You'll load data using an asynchronous function that simulates a request to an external data source. First, create a component called ...
Read more >
DataGrip does not show tables under schema
Hi,. I have configured my database in DataGrip and everything works fine except that I cannot see the tables under schema.
Read more >
Lazy Loading | Infinite Table DataGrid for React
With InfiniteTable you can lazily load data on demand - loading data is triggered by the user scrolling to a certain visible row...
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