Responsive display removes phone country code control

Responsive display removes phone country code control

kowadagokowadago Posts: 24Questions: 5Answers: 2
edited January 2018 in Free community support

Hello, I am using International telephone control https://github.com/jackocnr/intl-tel-input to allow users to set phone numbers with country codes. When allowing responsive DataTable, the control disappears from the input box.
I have two phone inputs "phone 1" & "phone 2" see attached photo, phone 1 already fits and the country code "displayed flag" works, however for "phone 2" the control disappeared.

Any recommendation or other phone country code plugins that you recommend?

This question has an accepted answers - jump to answer

Answers

  • gyrocodegyrocode Posts: 126Questions: 6Answers: 30
    Answer ✓

    Please see jQuery DataTables: Responsive extension and custom controls.

    Basically you need to re-initialize custom control when custom control gets hidden in a child row.


    See more articles about jQuery DataTables on gyrocode.com.

  • kowadagokowadago Posts: 24Questions: 5Answers: 2
    edited January 2018

    Thank you very much, reinitializing in the responsive-display function seems to have done the trick. This worked for me :)

    basically added the $(".phone").intlTelInput(); in the function like this:

    myDT.on( 'responsive-display', function ( e, datatable, row, showHide, update ) {
          console.log( 'Details for row '+row.index()+' '+(showHide ? 'shown' : 'hidden') );
          $(".phone").intlTelInput();
        } );
    
This discussion has been closed.