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.

Widget and camera
#1
HI !

When we install a camera in a widget, with the "auto open window" marked, it do not open automatically.

Has t he a solution for this issue ?

Regards.

JMM.
Jean-Marc
Reply
#2
(26.06.2017, 11:10)JMM Wrote: HI !

When we install a camera in a widget, with the "auto open window" marked, it do not open automatically.

Has t he a solution for this issue ?

Regards.

JMM.

Hi
You can create additional plan in Vis structure for camera and open it via Frame in needed plan.
Just tested it, and it works (firmware 20160927)
Reply
#3
Hi !

I found a solution for auto opening a camera on widget via js :

Code:
$("#widget-15 > div").trigger('vclick');

This solution works perfect with quick visualization but not wih user visualisation !
I don't understand why Sad
Somebody would have an idea ?

Regards
JMM
Jean-Marc
Reply
#4
You need to bind this event to the object that's opening the widget by using an additional CSS class (myclass):
Code:
$(function() {
  $('.myclass').on('vclick', function() {
    $("#widget-15 > div").trigger('vclick');
  });
});
Reply
#5
Thank you for the answer Admin !

My code was already bound to an event.

Code:
  // Open widget on KNX command
  grp.listen('2/3/4', function(object, state) {
    if (state == 'value' && object.value == true ) {
        // Command to show widget
      $("#widget-15").removeClass('hide');
      $("#widget-15 > div").trigger('vclick');
     
    }
  }, true); // set to true to execute on same object value

It works perfect with quick visualization
   

but not with user visualization !
   

JMM.
Jean-Marc
Reply
#6
You need to switch to the plan that has your widget first with showPlan(plan_id)
Reply
#7
HI,

The script here is which works well, it is not certainly very academic.... I does not follow a specialist of the js!

JMM.


Code:
// Init widget and change display and opacity
  $("#widget-27").removeClass('hide');
  $("#widget-27").css("display", "none").css("opacity", "0");
 
 // Open widget on KNX command
 grp.listen('2/3/4', function(object, state) {
   if (state == 'value' && object.value == true ) {
      // hide camera on widget In the case she would have remained open and triggered open button camera  
     $("#widget-27 > div").addClass('hide').trigger('vclick').css("pointer-events", "none");
     // Command to show widget
     $('#widget-27').css({'display':'block', 'opacity': '1', 'transform': 'perspective(800px)', 'top': '200px', 'left': '500px'});
   }
 }, true); // set to true to execute on same object value
 
 // Close widget on KNX command
 grp.listen('2/3/4', function(object, state) {
   if (state == 'value' && object.value == false ) {
      // Command to display widget
      $("#widget-27").css("display", "none").css("opacity", "0");
   }
 }, true); // set to true to execute on same object value
 
Jean-Marc
Reply


Forum Jump: