Allow input fields to render as readonly.

-=david=-
This commit is contained in:
David Harrigan 2018-01-02 12:55:31 +00:00 committed by Franco Fichtner
parent 3ae9866ea7
commit 7f7941c6e3
3 changed files with 6 additions and 3 deletions

View File

@ -90,6 +90,7 @@ label : dialog label
{% set maxheight=false %}
{% set width=false %}
{% set allownew=false %}
{% set readonly=false %}
{% if field['type'] == 'header' %}
{# close table and start new one with header #}

View File

@ -77,6 +77,7 @@ data_title : data-title to set on form
{% set maxheight=false %}
{% set width=false %}
{% set allownew=false %}
{% set readonly=false %}
{% if field['type'] == 'header' %}
{# close table and start new one with header #}

View File

@ -38,6 +38,7 @@ style : css class to add
maxheight : maximum height in rows if applicable
width : width in pixels if applicable
allownew : allow new items (for list) if applicable
readonly : if true, input fields will be readonly
#}
@ -54,7 +55,7 @@ allownew : allow new items (for list) if applicable
</td>
<td >
{% if type == "text" %}
<input type="text" class="form-control" size="{{size|default("50")}}" id="{{ id }}" >
<input type="text" class="form-control" size="{{size|default("50")}}" id="{{ id }}" {{ readonly ? 'readonly="readonly"' : '' }} >
{% elseif type == "checkbox" %}
<input type="checkbox" id="{{ id }}" >
{% elseif type == "select_multiple" %}
@ -63,9 +64,9 @@ allownew : allow new items (for list) if applicable
{% elseif type == "dropdown" %}
<select {% if size|default(false) %}size="{{size}}"{% endif %} id="{{ id }}" class="{{style|default('selectpicker')}}" data-width="{{width|default("348px")}}"></select>
{% elseif type == "password" %}
<input type="password" class="form-control" size="{{size|default("50")}}" id="{{ id }}" >
<input type="password" class="form-control" size="{{size|default("50")}}" id="{{ id }}" {{ readonly ? 'readonly="readonly"' : '' }} >
{% elseif type == "textbox" %}
<textarea rows="{{height|default("5")}}" id="{{ id }}"></textarea>
<textarea rows="{{height|default("5")}}" id="{{ id }}" {{ readonly ? 'readonly="readonly"' : '' }}></textarea>
{% elseif type == "info" %}
<span id="{{ id }}" ></span>
{% endif %}