Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Trigerring in cq:dialog

Avatar

Level 5

Can I trigger this clear button

1695294_pastedImage_0.png

using javascript that has a category of cq.authoring.dialog?
I'm trying to achieve something like
$(document).on("click","slide2", function (e) {

     // tab3 file clear triggered.

})

So when I click my slide 3 again, it sould be empty.

1 Accepted Solution

Avatar

Correct answer by
Level 5

Thanks but I was looking for this.

$(document).on("foundation-contentloaded", function (e) {

     $tar = $(".cq-dialog-file-upload", e.target);

     $($tar.closest('coral-fileupload').find('button')[1]).trigger("click")

}

It works but tell me if I'm doing something wrong.

View solution in original post

0 Replies

Avatar

Level 10

Add those when .dialog-ready event gets triggered.

Avatar

Correct answer by
Level 5

Thanks but I was looking for this.

$(document).on("foundation-contentloaded", function (e) {

     $tar = $(".cq-dialog-file-upload", e.target);

     $($tar.closest('coral-fileupload').find('button')[1]).trigger("click")

}

It works but tell me if I'm doing something wrong.

Avatar

Community Advisor

If you're trying to hit 'Clear' via code on dialog load/ready, this is the way to move forward..