Merge pull request #524 from 8191/mvc-fields

Additional fields in MVC library
This commit is contained in:
Ad Schellevis 2015-12-13 17:46:35 +01:00
commit ff563e7221
2 changed files with 6 additions and 2 deletions

View File

@ -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>
{% 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 }}" >
{% elseif type == "textbox" %}
<textarea rows="{{height|default("5")}}" id="{{ id }}"></textarea>
{% elseif type == "info" %}
<span id="{{ id }}" ></span>
{% endif %}

View File

@ -40,7 +40,7 @@
function getFormData(parent) {
var data = {};
$( "#"+parent+" input,#"+parent+" select" ).each(function( index ) {
$( "#"+parent+" input,#"+parent+" select,#"+parent+" textarea" ).each(function( index ) {
if ($(this).prop('id') == undefined) {
// we need an id.
return;
@ -96,7 +96,7 @@ function getFormData(parent) {
* @param data named array structure
*/
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) {
// we need an id.
return;