Prevent form-inline class?

Prevent form-inline class?

Peter-WesterlundPeter-Westerlund Posts: 4Questions: 1Answers: 0

Is it possible to prevent form-inline class when opening an hidden row with a form inside it?

Answers

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin

    This is on the DataTables container when using Bootstrap? You could use $( table.table().container() ).removeClass( 'form-inline' ); immediately after the table has been created, or alter the default class the Bootstrap integration uses.

    Allan

  • Peter-WesterlundPeter-Westerlund Posts: 4Questions: 1Answers: 0
    edited January 2017

    Thanks for the answer. Well, that's a way to go. But I would more like to know how it's meant to be for my purpose. I'm opening an row with "colspan 5"/full width and a form with form groups inside it. Is there any special to do in this case to keep the style and make jquery datatables handle this like an inline form? Is there any special style class that I should have on the form?

    Or some markup I can do so the inline class don't appear. What is the rules to make the inline class to be placed there? In some way I apparently tell the jQuery code that it's inline form.

  • Peter-WesterlundPeter-Westerlund Posts: 4Questions: 1Answers: 0

    I think I start to understand it better. Form-inline class is actually added from the beginning regardless of how the table is and if it has any form inside. It's added from dataTables.bootstrap.js.

    Seems it's only meant to be inline fields in the table. I might have to adapt to it.

  • Peter-WesterlundPeter-Westerlund Posts: 4Questions: 1Answers: 0

    Is it possible to have the primary edit (https://editor.datatables.net/examples/inline-editing/submitData.html) opening with an Edit link in the row? Not the checkbox in the example.

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin

    Form-inline class is actually added from the beginning regardless of how the table is and if it has any form inside. It's added from dataTables.bootstrap.js.

    That is correct. The BS4 integration drops the form-inline because it messes things up. Conversely I found it more difficult in BS3 to get inline editing working without that class!

    opening with an Edit link in the row?

    Yes, there is an example here.

    Allan

This discussion has been closed.