Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Blazor + DataTables


Hello,

Would be great to see DataTables sample with Search, Pagination in Blazor StarterKit

Main problem huge datasets loading - page halts

I found DataTables init in KTSubscriptionsList

Sample works, but on bigger data quantities halts:

private List<hotel> hotels { get; set; } = new List<hotel>();


protected override Task OnInitializedAsync()
{
hotels = db.hotel.Take(10000).ToList();

return base.OnInitializedAsync();
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JS.InvokeVoidAsync("KTSubscriptionsList.init");
await JS.InvokeVoidAsync("KTSubscriptionsExport.init");
}
}


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hello,

At this moment no errors in console - everything seems to work smooth and fast

Main problem how to link DataTable with database
Search, pagination, next, first page, take(100)
Mix JS with c# happy

BR,
Saulius



Hi Saulius,

In our documentation, we have the DataTable Server Side example, you can refer to this example and reuse HTML and JS code in your project.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hi,

Thank you for your feedback, we will consider adding this example in the next releases.

For the subscription list page, you should include and initialize the following js files.
assets/js/custom/apps/subscriptions/list/export.js
assets/js/custom/apps/subscriptions/list/list.js

Do you have any errors in your console?

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(