many fields in editor table cause screen to refresh too slow

many fields in editor table cause screen to refresh too slow

Yang.SongYang.Song Posts: 23Questions: 4Answers: 0

I have a screen where I have 225 fields that need to be displayed in editor although the actual table data only displays a dozen of them. The page takes about 40 seconds to load without any data. Most of time is spend on dataTable.add() because it has to loop through and add the 225 fields one by one and each add() call takes about 180-190 ms.

I was wondering if anyone else has similar issues or how we can go around it? Thanks!

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Most of time is spend on dataTable.add()

    Is that add()? If so, you wouldn't need to do that every time you add a record. Are you able to link to your page so we can take a look? Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • Yang.SongYang.Song Posts: 23Questions: 4Answers: 0

    I created a test case but it does not run on JS bin and when I used the referenced datatable editor running it locally, the error is " Uncaught TypeError: $.fn.dataTable.Editor is not a constructor". I'm not sure why. I still created the js Bin page and you can take a look. live.datatables.net/dunexoti/1/edit. I have comments in there. my local copy of the file is 1.9.1 and it works. I also included a copy of the screen print when it did work.

    If you want, you can copy the html and js into one file and save and then load from your local machine. It's straightforward and creates an editor table with three buttons - new/edit/delete and a table with fewer columns. Please let me know if you have any question or if you know why it does not work with the current library. Thanks!

  • Yang.SongYang.Song Posts: 23Questions: 4Answers: 0

    This is a simplified version that shows the slowness in creating the table. in this case, the editor table displays the same number of fields as the table. live.datatables.net/xupusodu/1/edit You can see it takes a while just to create an empty table because there are 100 fields.

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Let's merge this thread with this one which appears to be discussing the same issue.

    Allan

This discussion has been closed.