Don't remove row child

Don't remove row child

Toufik83Toufik83 Posts: 5Questions: 0Answers: 0

Is there any solution to hide row child responsive datatable ?
I have an input autocomplete with jquery-ui in row child, and when the child is hidden (removed), i loose the autocomplete on element input.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Do you mean you don't want Responsive to display a child row? If so, see this example.

    Allan

  • Toufik83Toufik83 Posts: 5Questions: 0Answers: 0
    edited February 2023

    allan, no i want juste to hide (not remove) the child row, is datatable always remove the child row when we close it with the responsive icon ?

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    I don't really understand. I'm not sure there is a difference between hiding and removing the child row in this context. Could you illustrate what you are looking to do please?

    Allan

  • Toufik83Toufik83 Posts: 5Questions: 0Answers: 0

    Allan,
    When i close the responsive child row, the element "tr.child" is completely removed from the DOM, or i want to keep it but just invisible, is it possible ?

    If you want, i can make an online example on jsfiddle or codepen to see more.

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited February 2023

    You may need to use responsive-display to re-instate the autocomplete widget.

    Are you using this with Editor?

    Its probably best to provide a test case so we can see how you are using jQuery UI Autocomplete.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • Toufik83Toufik83 Posts: 5Questions: 0Answers: 0

    Hi Allan and kthorngren,

    Here is the link : https://jsfiddle.net/Toufi9/g5qy6zo1/

    I just made a quick example in client side mode, but the original code (the one I use) is in serverSide mode.

    The steps to follow to see the bug:
    1- click on the edit button, two autocompletes inputs are displayed and work well, then open the responsive menu of the row by clicking on the responsive icon, and there the autocomplete does not work for the two inputs of the row .child.

    2-Increase the width of the page, the two entries of the row child ".child" are not added to their original row, since the child is permanently deleted from the DOM.

    I don't want to apply autocomplete multiple times to elements, or clone them, besides cloning an autocomplete element doesn't work.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It would be worth looking at this example here. It's demonstrating how Editor can update cells even though they're responsively hidden.

    Colin

  • Toufik83Toufik83 Posts: 5Questions: 0Answers: 0

    Thanks colin for the link, I knew about Editor and I tested it for a few days, then as it's not free, the trial version is over.
    But I think you gave me a good idea, and use a modal window for editing instead of doing it inline.

Sign In or Register to comment.