Commit 0e3f1f2f authored by Sven Franck's avatar Sven Franck

app: add data-widget/map to HTML output as hint on updates

parent 562301c6
...@@ -1827,6 +1827,7 @@ ...@@ -1827,6 +1827,7 @@
*/ */
// TODO: add collapsible support if needed // TODO: add collapsible support if needed
// TODO: dividers? will not be in spec, so can only be listview option! // TODO: dividers? will not be in spec, so can only be listview option!
// TODO: find better way to set mapper/widget
factory.widget.listview = function (spec) { factory.widget.listview = function (spec) {
var fragment, has_filter, generator; var fragment, has_filter, generator;
...@@ -1937,18 +1938,22 @@ ...@@ -1937,18 +1938,22 @@
(spec.inset ? (spec.inset ?
" ui-listview-inset ui-corner-all ui-shadow " : "") " ui-listview-inset ui-corner-all ui-shadow " : "")
}, },
"attributes": {"data-role": "listview", "data-enhanced": true}, "attributes": {
"data-role": "listview",
"data-enhanced": true,
// NOTE: on updates, we need wrapper with generator and mapper???
"data-widget": "listview"
},
"logic": { "logic": {
"id": spec.id || null, "id": spec.id || null,
"data-update": spec.dynamic ? true : null, "data-update": spec.dynamic ? true : null,
// NOTE: on updates, we need wrapper with generator...
"data-widget": "listview",
"data-reference": spec.reference || null, "data-reference": spec.reference || null,
"data-filter": spec.filter || null, "data-filter": spec.filter || null,
"data-input": spec.input || null, "data-input": spec.input || null,
"data-filter-theme": spec.filter_theme || null, "data-filter-theme": spec.filter_theme || null,
"data-filter-placeholder": spec.placeholder || null, "data-filter-placeholder": spec.placeholder || null,
"data-divider-theme": spec.divider_theme || null "data-divider-theme": spec.divider_theme || null,
"data-map": spec.map_children || null
} }
})); }));
} }
...@@ -2297,7 +2302,8 @@ ...@@ -2297,7 +2302,8 @@
"attributes": { "attributes": {
"data-update": "true", "data-update": "true",
"data-widget": "table" "data-widget": "table"
} },
"logic": {"data-map": spec.map_children || null}
})); }));
break; break;
} }
...@@ -4639,10 +4645,8 @@ ...@@ -4639,10 +4645,8 @@
{ {
"portal_type_source": config.state.type, "portal_type_source": config.state.type,
"portal_type_title": config.state.title, "portal_type_title": config.state.title,
"property_dict": util.mergeObject({ "property_dict": util.mergeObject(
"dynamic": true, {"dynamic": true},
"map_children": config.state.dyno_dict.map_children
},
config.state.dyno_dict), config.state.dyno_dict),
"scheme": config.state.scheme "scheme": config.state.scheme
}, },
...@@ -4893,10 +4897,8 @@ ...@@ -4893,10 +4897,8 @@
{ {
"portal_type_source": config.state.type, "portal_type_source": config.state.type,
"portal_type_title": config.state.title, "portal_type_title": config.state.title,
"property_dict": util.mergeObject({ "property_dict": util.mergeObject(
"dynamic": true, {"dynamic": true},
"map_children": config.state.dyno_dict.map_children
},
config.state.dyno_dict), config.state.dyno_dict),
"scheme": config.state.scheme "scheme": config.state.scheme
}, },
...@@ -6313,12 +6315,14 @@ ...@@ -6313,12 +6315,14 @@
} }
} }
} else { } else {
// TODO: can this be done without storing on and querying DOM???
widget = pass.state.gadget.querySelector("[data-update]") widget = pass.state.gadget.querySelector("[data-update]")
.getAttribute("data-widget"); wrapper.property_dict.map_children = widget.getAttribute("data-map");
wrapper = util.mergeObject( wrapper = util.mergeObject(
factory.widget[widget](wrapper.property_dict), factory.widget[widget.getAttribute("data-widget")](wrapper.property_dict),
wrapper wrapper
); );
// add scheme and field_dict to list // add scheme and field_dict to list
kids = util.inherit( kids = util.inherit(
pointer_results.data.rows, pointer_results.data.rows,
...@@ -6437,6 +6441,7 @@ ...@@ -6437,6 +6441,7 @@
for (k = 0, l = response_list.length; k < l; k += 1) { for (k = 0, l = response_list.length; k < l; k += 1) {
response = response_list[k]; response = response_list[k];
done_target = undefined; done_target = undefined;
if (response) { if (response) {
// generate target for and append response // generate target for and append response
// NOTE: wrapper.spec is used for header only. // NOTE: wrapper.spec is used for header only.
......
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