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

3 Kommentare

  • Ahmed Zaid
    Community Moderator

    Hi Benessa Dumol,

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

    0
  • 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);
        client.off("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

    0
  • 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,
    Benessa

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Powered by Zendesk