Allow class in field definition
I'm customizing my bootstrap views for mobile layout and would like to specify fields that are only shown in the desktop view using the bootstrap class "visible-desktop". I'd like to use the "class" specification as part of "fields" to accomplish this.
I'm particularly interested in doing this for a data_view.
I assume the best alternative at this point is to create a template.
@perak I was looking to work on adding this feature to Meteor Kitchen but I don't see the actual kitchen source posted. Is this something I can help with?
@rgstephens excuse me for late answer. Kitchen-cli is not open source yet. I published on kitchen site that my attention is to open the source (and it is) but I was under negotiations with the company who asked me to wait - to not open the source yet before they decide what to do.
Now, I can say that kitchen-cli will go open source for sure, please just a little bit patience. And thank you fir your good will to contribute.
About your particular problem: in meantime, I can add possibility to define any css class to the generated fields. Would that work?
@perak That would work great. Thanks.
@rgstephens added input_control_class property to field object. And there is old input_group_class property too.
This example shows where classes will be added:
<div class="form-group INPUT_GROUP_CLASS">
<label for="someField">Some Field</label>
<div class="input-div">
<input type="text" name="someField" value="12345" class="form-control INPUT_CONTROL_CLASS">
<span id="error-text" class="help-block"></span>
</div>
</div>
Will be published in v0.9.63 most likely tomorrow (~24 hours after now).
@perak, this is working as you've documented it with forms but I'd also like to set class when the field is used in a table. It may be that I'll start using custom_template more.
In the end, I think it would be better to have view-based class settings. "class_in_dataview" or something like that.
@rgstephens ah... data_view, not form - I didn't read issue carefully enough. I'll add that in next version.