The initial time for the editor instance with template option is more than 2 seconds

The initial time for the editor instance with template option is more than 2 seconds

casuistcasuist Posts: 16Questions: 7Answers: 0

There is a custom template html for the editor. (About 200 lines)
Initial instance js. (About 2000 lines)
The initial time for the editor instance with template option is more than 2 seconds ..
The initial time for No template option editor instance is less than 100 milliseconds.
How can I solve it?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 6,849Questions: 0Answers: 1,170

    Hi @casuist ,

    Without being able to see it, or the code, it's hard to make any recommendations. Would you be able to link to your page, or modify this test case here to demonstrate the performance issues, please.

    Cheers,

    Colin

  • casuistcasuist Posts: 16Questions: 7Answers: 0

    I edited it.
    toggle template option.
    view console.log please.

    Thanks for your help!

  • casuistcasuist Posts: 16Questions: 7Answers: 0
  • colincolin Posts: 6,849Questions: 0Answers: 1,170

    Hi @casuist ,

    Thanks for that, unfortunately there are console errors so the table isn't loading.

    Cheers,

    Colin

  • colincolin Posts: 6,849Questions: 0Answers: 1,170

    Hi @casuist ,

    Thanks for that, unfortunately there are console errors so the table isn't loading.

    Cheers,

    Colin

  • casuistcasuist Posts: 16Questions: 7Answers: 0

    datatable is don't care.
    my issue is editor initial time.
    look console log.

    console.log('start user_list_editor ' + new Date());
    var user_list_editor = new $.fn.dataTable.Editor({
             table : "#user-list",
         template : '#userForm', //toggle this option please
           ...........
    });
    console.log('end user editor ' + new Date());
    

    run with template option ->
    start user_list_editor Tue Jul 16 2019 21:38:08 GMT+0900 (한국 표준시)
    end user editor Tue Jul 16 2019 21:38:10 GMT+0900 (한국 표준시)
    with no template option ->
    start user_list_editor Tue Jul 16 2019 21:41:39 GMT+0900 (한국 표준시)
    end user editor Tue Jul 16 2019 21:41:39 GMT+0900 (한국 표준시)

  • allanallan Posts: 50,854Questions: 1Answers: 7,622 Site admin
    Answer ✓

    If you've got 209 fields, a two second initialisation time with a custom form doesn't too bad. That said, if you can give us a running example I'd like to profile it to see if there are any improvements we can make.

    Thanks,
    Allan

  • casuistcasuist Posts: 16Questions: 7Answers: 0

    Thanks for your answer.
    please delete code ( http://live.datatables.net/beteziho/2/edit ) .

    Best Regard

  • colincolin Posts: 6,849Questions: 0Answers: 1,170

    Hi @casuist ,

    Only the owner can delete it. If you got to the File menu, there's an option there to delete.

    Cheers,

    Colin

  • casuistcasuist Posts: 16Questions: 7Answers: 0

    Solved It!.
    use templete api, when inital finished.

Sign In or Register to comment.