Open modal when rendering large amount of data in C#

Open modal when rendering large amount of data in C#

GreatNewsGreatNews Posts: 5Questions: 2Answers: 0
edited February 2019 in Free community support

Hi, I'm using DataTables in an ASP NET - Web Form. The problem is that I cannot use AJAX request to bind data to a gridview because of the project's backend structure.
The process is secuencial. I retrieve data from backend, bind it to the gridview. Then, in frontend, I add the header to the table (by default the table in ASP doesn't have the <thead> tag) and, finally, apply the DataTable style.
It all works fine but the issue is it takes some seconds to apply the styles. I want to "avoid" that showing a "Loading" modal but it appears AFTER the styles are applied.

Getting straight to the point. I want to show a modal with JQuery BEFORE the DataTables styles started to be applied. I have no problem closing it after it's all applied.

Answers

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin

    A few options based on those requirements:

    1. Put a position:fixed element covering the whole window which says "loading" and remove it when the table is fully rendered.
    2. Put the DataTable in a hidden div and then make it visible once fully rendered.

    Allan

  • GreatNewsGreatNews Posts: 5Questions: 2Answers: 0

    das

  • GreatNewsGreatNews Posts: 5Questions: 2Answers: 0

    Thanks for answering, Allan.

    That's an option but it's not what I was really looking for. The main problem is the time the user has to wait until the application show some data. If I hide the datatable the user may think that something went wrong. I know it's a matter of seconds but it's not good for user experience. I know I could add another loading modal in each web form but it means adding more complexity to the application. Nowaday all the Datatables issue it's being managed by a single Javascript file and, if it's possible, I'd like to keep it like that

    Another think I was thinking it's combining ASP Gridview with Datatables.
    I explain myself.

    The main things we are interested in are the responsivity, exports buttons and searching. It would be nice if we could use ASP pagination combined with those issues. I've been searching about it but, unfortunatelly, I did not come across anything.

    Sorry for me english. I hope I explained myself clearly.

This discussion has been closed.