Different class for input fields inline vs. form
Different class for input fields inline vs. form
bfarkas
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
This discussion has been closed.
Answers
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
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.
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
Thanks, had a feeling it would end up being that kind of a route but was hoping I was missing something.
Actually, found a simpler solution. No scripting needed. Just distinguishing between whether the form wrapper is there or not: