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.

Open a widget from another widget
#1
Hi. I am creating a visualization. I created a home page with a button called "lighting", when I click, I open a widget with different options, and when selecting the desired option, I want to open another widget and keep the first one. It's possible?
Reply
#2
Button that opens main widget must have static-widget Additional class. In Custom JS change number in widget ID (widget-23) to your widget ID (you can view this in browser dev tools (F12)). Your widget must used fixed position that can be set in widget settings. Main widget can only be closed by clicking on the button that opens it or by changing plans. Other widgets are closed by clicking outside of widget area.

Custom CSS:
Code:
.force-show {
  display: block !important;
}

Custom JS:
Code:
$(function() {
  var widget = $('#widget-23').removeClass('layer').css('position', 'absolute');
  
  $(document.body).on('showplan', function() {
    widget.removeClass('force-show');
  });
  
  $('.static-widget').on('vclick', function() {
    widget.toggleClass('force-show', !widget.hasClass('hide'));
  });
});
Reply
#3
(27.11.2019, 09:27)admin Wrote: Button that opens main widget must have static-widget Additional class. In Custom JS change number in widget ID (widget-23) to your widget ID (you can view this in browser dev tools (F12)). Your widget must used fixed position that can be set in widget settings. Main widget can only be closed by clicking on the button that opens it or by changing plans. Other widgets are closed by clicking outside of widget area.

Custom CSS:
Code:
.force-show {
  display: block !important;
}

Custom JS:
Code:
$(function() {
  var widget = $('#widget-23').removeClass('layer').css('position', 'absolute');
 
  $(document.body).on('showplan', function() {
    widget.removeClass('force-show');
  });
 
  $('.static-widget').on('vclick', function() {
    widget.toggleClass('force-show', !widget.hasClass('hide'));
  });
});
Hi. With your steps I can block the widget, but the second widget can't keep it in sight, it opens and closes quickly. Will I need any more parameters?
Reply
#4
Can you send your backup via PM?
Reply
#5
(02.12.2019, 14:12)admin Wrote: ¿Puedes enviar tu copia de seguridad a través de PM?
Hola. Detecté la falla y la puse a trabajar. Pero eso tampoco sería correcto.

Necesito configurar una página de "1360 x 768" y en la configuración de visualización "visto en PC / Tablet-> Páginas centrales, el tamaño es autorregulado" Así que obtengo cualquier monitor para ajustar la imagen de mi proyecto. Pero cuando da esta configuración, el widget se desvanece de su posición. Tampoco puedo darle un efecto de transición de página.

Usuario / Pase: admin / 12345678

Attached Files
.gz   Project-LogicMachine-2019.12.02-18.11.tar.gz (Size: 341.55 KB / Downloads: 13)
Reply
#6
Try installing 2019 RC1 firmware, positioning work correctly for me in this version. If you need multiple widgets it's better to use different classes (static-widget1 and static-widget2). Transitions will not work.

Code:
$(function() {
  var w1 = $('#widget-2').removeClass('layer').css('position', 'absolute');
  var w2 = $('#widget-4').removeClass('layer').css('position', 'absolute');
  
  $(document.body).on('showplan', function() {
    w1.removeClass('force-show');
    w2.removeClass('force-show');
  });
  
  $('.static-widget1').on('vclick', function() {
    w2.removeClass('force-show');
    w1.toggleClass('force-show', !w1.hasClass('hide'));
    hideWidgets();
  });

  $('.static-widget2').on('vclick', function() {
    w1.removeClass('force-show');
    w2.toggleClass('force-show', !w2.hasClass('hide'));
    hideWidgets();
  });
});
Reply
#7
(03.12.2019, 07:30)admin Wrote: Try installing 2019 RC1 firmware, positioning work correctly for me in this version. If you need multiple widgets it's better to use different classes (static-widget1 and static-widget2). Transitions will not work.

Code:
$(function() {
  var w1 = $('#widget-2').removeClass('layer').css('position', 'absolute');
  var w2 = $('#widget-4').removeClass('layer').css('position', 'absolute');
 
  $(document.body).on('showplan', function() {
    w1.removeClass('force-show');
    w2.removeClass('force-show');
  });
 
  $('.static-widget1').on('vclick', function() {
    w2.removeClass('force-show');
    w1.toggleClass('force-show', !w1.hasClass('hide'));
    hideWidgets();
  });

  $('.static-widget2').on('vclick', function() {
    w1.removeClass('force-show');
    w2.toggleClass('force-show', !w2.hasClass('hide'));
    hideWidgets();
  });
});
effectively! the problem is corrected with the new version of firm. Anyway, the effect of page transition continues to affect the widget, I do not mind removing it, but in case you want to take it into account in the next update.

Thank you very much
Reply


Forum Jump: