Commit 31919118 authored by Ad Schellevis's avatar Ad Schellevis

(mvc) make setFormData aware of span tags to put data (info labels)

parent d34b2555
...@@ -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" ).each(function( index ) { $( "#"+parent+" input,#"+parent+" select,#"+parent+" span" ).each(function( index ) {
if ($(this).prop('id') == undefined) { if ($(this).prop('id') == undefined) {
// we need an id. // we need an id.
return; return;
...@@ -127,6 +127,11 @@ function setFormData(parent,data) { ...@@ -127,6 +127,11 @@ function setFormData(parent,data) {
} else { } else {
targetNode.prop("checked",false) ; targetNode.prop("checked",false) ;
} }
} else if (targetNode.is("span")) {
if (node[keypart] != null) {
targetNode.text("");
targetNode.append($.parseHTML(String(node[keypart])));
}
} else { } else {
// regular input type // regular input type
targetNode.val(node[keypart]); targetNode.val(node[keypart]);
......
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