Different class for input fields inline vs. form

Different class for input fields inline vs. form

bfarkasbfarkas Posts: 181Questions: 48Answers: 0

Is it possible to add a different class to the input fields when they are inline vs. in the form? They generally need different styles and tweaks, but effect each other. I was looking at the JavaScript file that adds the classes for the different elements but the input is a general one.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    Maybe a form template will do what you want for the form. The inline classes would probably be set where you are creating the inputs, columns.render maybe.

    Kevin

  • bfarkasbfarkas Posts: 181Questions: 48Answers: 0

    Iā€™m currently doing that. When I add/modify the input classes it applies to both the form template and the inline both replace the variables with the same input element with the same classes dictated in the editor JavaScript file, in my case the foundations file.

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    Answer āœ“

    This example shows one option:
    http://live.datatables.net/guwafemu/131/edit

    Define two classes; one for inline and the other for form editing. When inline editing remove the form class from each cell and add the inline class. When form editing do the opposite.

    There may be better ideas posted.

    Kevin

  • bfarkasbfarkas Posts: 181Questions: 48Answers: 0

    Thanks, had a feeling it would end up being that kind of a route but was hoping I was missing something.

  • bfarkasbfarkas Posts: 181Questions: 48Answers: 0

    Actually, found a simpler solution. No scripting needed. Just distinguishing between whether the form wrapper is there or not:

    .DTE_Field_InputControl {
        width: 85%;
        margin: 0 auto;
    }
    #dataEntryForm .DTE_Field_InputControl {
        width: 100%;
        margin: 0 auto;
    }
    
This discussion has been closed.