This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Align values to right
#7
Hi Thomas,

You could use this also to scale your Lux values on client side, this way you don't need the dummy objects and server side event based scaling (:

This code is for both PC tablet and Touch visu (see lines 8 and 10)

Code:
$(function(){
 
 function LuxScale(value, classname){  
   value= value / 1000;
   value = value.toFixed(2);
   value =  value  + " klx";
   // Update PC / Tablet visu
   $("." + classname + ".item-value").text(value);
   // Update Touch visu
   $("." + classname).find(".control-value").text(value);
 }
 
 // Listener on object 1/1/14 with custom classname "lux1" (East side)
 if (typeof grp != 'undefined') {
   grp.listen('1/1/14', function(object, state) {
    LuxScale(object.value, "lux1");
   }, false);
 }
 
 // Listener on object 1/1/15 with custom classname "lux2" (South)
 if (typeof grp != 'undefined') {
   grp.listen('1/1/15', function(object, state) {
    LuxScale(object.value, "lux2");
   }, false);
 }
 
 // Listener on object 1/1/16 with custom classname "lux3" (West)
 if (typeof grp != 'undefined') {
   grp.listen('1/1/16', function(object, state) {
    LuxScale(object.value, "lux3");
   }, false);
 }
 
});
BR,

Erwin
Reply


Messages In This Thread
Align values to right - by Thomas - 11.03.2017, 16:52
RE: Align values to right - by Trond Hoyem - 30.03.2017, 11:47
RE: Align values to right - by Thomas - 12.03.2017, 13:30
RE: Align values to right - by Thomas - 12.03.2017, 15:32
RE: Align values to right - by Erwin van der Zwart - 12.03.2017, 20:13
RE: Align values to right - by Thomas - 13.03.2017, 12:02
RE: Align values to right - by admin - 14.03.2017, 10:52

Forum Jump: