= ele.minValue)
+ var max_ok_fl = (!ele.hasOwnProperty('maxValue')) || (value <= ele.maxValue)
+
+ if( min_ok_fl && max_ok_fl )
{
ele.value = value;
if( ele.decpl == 0 )
@@ -689,6 +577,26 @@ function ui_set_number_value( ele, value )
}
+function ui_set_title( ele, d )
+{
+ if( ele.tagName.toLowerCase() == "button" )
+ ele.innerHTML = d.value;
+ else
+ {
+ // most controls will have a sibling element of type 'label'
+ var label_eles = ele.parentNode.getElementsByTagName("label");
+
+ if( label_eles != null && label_eles.length > 0 )
+ {
+ label_eles[0].innerHTML = d.value
+ }
+ else
+ {
+ ui_error("set_title() target element not found.");
+ }
+ }
+}
+
function ui_set_number_range( ele, d )
{
_ui_set_number_range(ele,d)
@@ -722,6 +630,8 @@ function ui_create_number( parent_ele, d )
function ui_set_number_display( ele_id, value )
{
+ //console.log("Numb disp: " + ele_id + " " + value)
+
var ele = dom_id_to_ele(ele_id);
if( typeof(value)=="number")
@@ -831,9 +741,14 @@ function ui_set_log_text( ele, value )
function ui_create_log( parent_ele, d )
{
// create a containing div with the label
- d.className = "uiLog"
+
+ if( !d.hasOwnProperty('className') )
+ d.className = "uiLog"
+
var log_ele = ui_create_ctl( parent_ele, "div", d.title, d, "uiLog" )
+
+
// add a to the containing div
var ele = dom_create_ele("pre")
@@ -846,19 +761,15 @@ function ui_create_log( parent_ele, d )
return log_ele
}
-function ui_create_list( parent_ele, d )
+function ui_create_list( parent_ele, d, class_label )
{
- d.className = "uiList"
- console.log(d)
- var list_ele = ui_create_ctl( parent_ele, "div", d.title, d, "uiList" )
+ var list_ele = ui_create_ctl( parent_ele, "div", d.title, d, class_label )
return list_ele
}
function ui_set_value( d )
{
- //console.log(d)
-
var eleId = d.uuId.toString()
var ele = dom_id_to_ele(eleId)
@@ -933,8 +844,15 @@ function ui_set_value( d )
function _ui_modify_class( ele, classLabelArg, enableFl )
{
let classLabel = " " + classLabelArg; // prefix the class label with a space
+
+ //console.log(ele.id + " " + classLabelArg + " " + enableFl )
+
+ let isEnabledFl = false;
- let isEnabledFl = ele.className.includes(classLabel)
+ if( ele.hasOwnProperty("className") )
+ isEnabledFl = ele.className.includes(classLabel)
+ else
+ ele.className = ""
// if the class is not already enabled/disabled
if( enableFl != isEnabledFl )
@@ -944,6 +862,8 @@ function _ui_modify_class( ele, classLabelArg, enableFl )
else
ele.className = ele.className.replace(classLabel, "");
}
+
+ //console.log(ele.id + " " + ele.className + " " + enableFl )
}
function ui_set_select( ele, enableFl )
@@ -1013,7 +933,7 @@ function ui_set_order_key(ele, orderKey)
function ui_set( d )
{
- console.log(d)
+ //console.log(d)
var ele = dom_id_to_ele(d.uuId.toString())
if( ele == null )
@@ -1023,6 +943,10 @@ function ui_set( d )
{
switch( d.type )
{
+ case "title":
+ ui_set_title(ele,d);
+ break;
+
case "number_range":
ui_set_number_range(ele, d)
break;
@@ -1055,6 +979,14 @@ function ui_set( d )
}
}
+function ui_cache( d )
+{
+ for(i=0; i