Can I call a function when pop-up modal is opened?

3 Comentarios

  • Ahmed Zaid
    Community Moderator

    Hi Benessa Dumol,

    Are you creating a new modal instance with each click of these buttons? 

  • Benessa Dumol

    Hi Ahmed Zaid,

    Thank you for responding to my query.

    Yes, I am creating a new instance using this script

    client.invoke('instances.create', {
      location: 'modal',
      url: 'assets/modal.html',
      size: { // optional
        width: '80vw',
        height: '70vh'
    }).then(function(modalContext) {
      // The modal is on the screen now!
      var modalClient = client.instance(modalContext['instances.create'][0].instanceGuid);
      client.on('modalReady', function setHtml(){
        modalClient.trigger('drawData', html);"modalReady", setHtml);
      modalClient.on('modal.close', function() {
      // The modal has been closed.
        console.log('The modal has been closed');

    Let me know if you want to see my whole code.

    Thank you,

  • Benessa Dumol

    Hello Ahmed Zaid, do you have other input to my question above?

    I've looked for ways to fix this issue but was not successful.

    Looking forward to any response.

    Thank you,


Iniciar sesión para dejar un comentario.

Tecnología de Zendesk