26.04.2016, 12:11
(This post was last modified: 26.04.2016, 12:44 by Erwin van der Zwart.)
Another nice custom Javascript feature: Jump to page by object value (value = 1 -> page = #1, value = 100 -> page = #100)
BR,
Erwin van der Zwart
Code:
$(function() {
var PageNumberObject = Scada.encodeGroupAddress('1/1/1'); // Use 1 byte or 2 byte unsigned integer object !
objectStore.addListener(PageNumberObject, function(obj, type) {
// Condition to avoid jump to page of object value on visu load
if(type == 'init'){
// Exit function on first load, remove the return if you want to jump direct to the page on visu load
return;
}
// Condition to jump to page of object value if page is not already there
if( obj.datatype.major == 5 || obj.datatype.major == 6 ){
if ( currentPlanId != obj.value ) {
showPlan(obj.value);
}
}
});
});
BR,
Erwin van der Zwart