• Resolved charles godwin

    (@charlesgodwin)


    I’m trying to determine how to get CSS to work to re position the search and show XX dialog. I’d like the Search box to be left aligned and followed by the size box, either adjacent to search or on the right.

    I know some CSS but am not a wizard.

    I tried some CSS in the customizer but it didn’t seem to work. Ideally I’d like to do this on individual pubs. Can I add css style to the table options or the shortcode?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter charles godwin

    (@charlesgodwin)

    I’ve done some reading and dataTables supports this.

    click here

    This explains the “what to do” but I need some help with the “How”. I understand the concepts of DOM model but the specifics of doing this inside a WordPress page or block or as pub options is a skill I want learn.

    Can anyone help? Thanks.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Charles,

    The dom option allows you to change the order in which the filter and length items are shown, but it won’t make a difference when you put them on the same line. The reason is that the styling of both options uses a float. One item is floated right and one left. So changing the order will give you the same result.

    You need to change the css. The simplest way is to add the following css to your WordPress theme in the additional css section:

    .dataTables_wrapper .dataTables_filter {
    float: left !important;
    text-align: left !important;
    }

    .dataTables_wrapper .dataTables_length {
    float: right !important;
    }

    Not a beauty, but it works. Note that this will restyle all DataTables on your website. If you want to change the styling for one specific DataTable only, use the id. You’d get something like this:

    #wpda_sas_student_filter.dataTables_filter {
    float: left;
    text-align: left;
    }

    #wpda_sas_student_length.dataTables_length {
    float: right;
    }

    You don’t need to add the !important property if you use the id as it is more specific, but you need to do it for every DataTable.

    Hope this helps!

    Best regards,
    Peter

    Thread Starter charles godwin

    (@charlesgodwin)

    Thanks. The CSS help worked.

    I still need a bit of guidance on getting the DOM model to work. I can’t seem to get it to work. Once it works I can experiment with different setup ups.

    I have an embedded script in this page but it’s not working.
    https://ottawa.ogs.on.ca/researching/indexes/library-catalog/

    Search for “// inserted by Charles Godwin 2020-01-03” in the html

    All help will be appreciated. Thanks

    This is NOT urgent

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Charles,

    I haven’t used the dom parameter before, but it works for me. Can you try to enter the following string in column “Table options (advanced)”: {"dom":"iptlfr"}

    Where:
    l – length changing input control
    f – filtering input
    t – The table!
    i – Table information summary
    p – pagination control
    r – processing display element

    Be aware that you need to write double quotes around your text. The example above switches the header and footer info. The default is: {“dom”:”lfrtip”}

    Best regards,
    Peter

    Thread Starter charles godwin

    (@charlesgodwin)

    Works like a charm. I used {"dom":"flirptip"}

    Thanks again.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Great! 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Repositioning Search and Show xx records’ is closed to new replies.