Commit ff563e72 authored by Ad Schellevis's avatar Ad Schellevis

Merge pull request #524 from 8191/mvc-fields

Additional fields in MVC library
parents 3da643e0 6f72aedb
...@@ -61,6 +61,10 @@ allownew : allow new items (for list) if applicable ...@@ -61,6 +61,10 @@ allownew : allow new items (for list) if applicable
<br/><a href="#" class="text-danger" id="clear-options" for="{{id}}"><i class="fa fa-times-circle"></i></a> <small>{{ lang._('Clear All') }}</small> <br/><a href="#" class="text-danger" id="clear-options" for="{{id}}"><i class="fa fa-times-circle"></i></a> <small>{{ lang._('Clear All') }}</small>
{% elseif type == "dropdown" %} {% elseif type == "dropdown" %}
<select {% if size|default(false) %}size="{{size}}"{% endif %} id="{{ id }}" class="{{style|default('selectpicker')}}" data-width="{{width|default("348px")}}"></select> <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 }}" >
{% elseif type == "textbox" %}
<textarea rows="{{height|default("5")}}" id="{{ id }}"></textarea>
{% elseif type == "info" %} {% elseif type == "info" %}
<span id="{{ id }}" ></span> <span id="{{ id }}" ></span>
{% endif %} {% endif %}
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
function getFormData(parent) { function getFormData(parent) {
var data = {}; var data = {};
$( "#"+parent+" input,#"+parent+" select" ).each(function( index ) { $( "#"+parent+" input,#"+parent+" select,#"+parent+" textarea" ).each(function( index ) {
if ($(this).prop('id') == undefined) { if ($(this).prop('id') == undefined) {
// we need an id. // we need an id.
return; return;
...@@ -96,7 +96,7 @@ function getFormData(parent) { ...@@ -96,7 +96,7 @@ function getFormData(parent) {
* @param data named array structure * @param data named array structure
*/ */
function setFormData(parent,data) { function setFormData(parent,data) {
$( "#"+parent+" input,#"+parent+" select,#"+parent+" span" ).each(function( index ) { $( "#"+parent+" input,#"+parent+" select,#"+parent+" span,#"+parent+" textarea" ).each(function( index ) {
if ($(this).prop('id') == undefined) { if ($(this).prop('id') == undefined) {
// we need an id. // we need an id.
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment