Editor freezing screen when extending "edit" functionality

Editor freezing screen when extending "edit" functionality

Hi again,

My datatable has checkboxes and datetime fields in each row that I'd like to edit inline. I've run into a few interesting issues that I can't quite seem to figure out.

  1. Inline editing with static checkboxes yields the following message in the console: "Field is still processing". I'm following the examples in these 2 articles https://datatables.net/blog/2014-09-09#PHP & https://editor.datatables.net/examples/api/checkbox. This also freezes up my webpage, in which I can't do anything until chrome allows me to exit the page. FYI I don't have any dependencies on fields.

  2. I tried moving inline editing to the more traditional way of editing a row using editor and I'm still seeing the webpage freeze up. It looks like the editor modal is usable for about the first 5 seconds before it becomes non-responsive.

Not sure if this is an issue on my end or the underlying editor code. Any and all help would be appreciated!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    The error is explained in this technote. It sounds like there is a previous Editor field that has not completed an update. Are you doing something with a different field before this error? If yes does it complete its process?

    Can you provide a link to your page or test case replicating the issue so we can help debug?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • datatables_admin@myvoicecomm.comdatatables_admin@myvoicecomm.com Posts: 10Questions: 4Answers: 1

    @kthorngren I'm working on getting you an example that shows the issue I'm experiencing, however, in the meantime I do have a bit more information for you.

    I have a select2 field type in my editor configuration that is really only used for new record creations. After reading your comment and thinking about what "Field is still processing" actually means, I've determined that this field seems to be the culprit. When I comment this field out everything works fine in terms of create, edit and delete. Not sure what could be causing this as I have a minimumInputLength of 1 on the select2 ajax call. I've posted my editor configuration below for more visibility. Let me know if there is anything else I can provide, besides a working example, that could help resolve this

    { label: "Customer", id: 'customerSelect2', name: 'customer_id', type: 'select2', opts: { minimumInputLength: 1, ajax: { url: "{{URL::current()}}/create/customerSearch", type: 'GET', dataType: 'json', processResults: function (data) { // Transforms the top-level key of the response object from 'items' to 'results' return { results: data }; } // Additional AJAX parameters go here; see the end of this chapter for the full code of this example } } }

  • datatables_admin@myvoicecomm.comdatatables_admin@myvoicecomm.com Posts: 10Questions: 4Answers: 1
    Answer ✓

    Figured out what was going on. Looks like the select2 field was firing off a request for search with "initialValue: true" on opening the editor. My backend code was not respecting this and thus was returning 57k+ rows which the browser can't handle. This explains why it was locking up. Returning an empty array when "initialValue" is provided fixed the problem

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    Good, glad you found the issue!

    Kevin

Sign In or Register to comment.