Skip to main content
Karl515
Level 5
2月 20, 2019 4:08 上午 UTC
已解决

Trigerring in cq:dialog

Can I trigger this clear button

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.

此主题已关闭回复。
Karl515
Karl515回答
Level 5
2月 20, 2019 5:01 上午 UTC

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.

3回复

edubey
Level 10
2月 20, 2019 4:57 上午 UTC

Add those when .dialog-ready event gets triggered.

翻译
Karl515
Karl515作者回答
Level 5
2月 20, 2019 5:01 上午 UTC

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.

翻译
Gaurav-Behl
Level 10
2月 20, 2019 3:16 下午 UTC

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

翻译