Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
blockly > dialog > setConfirm
Fungsi dialog.setConfirm()
Menetapkan fungsi yang akan dijalankan saat Blockly.dialog.confirm() dipanggil.
Tanda Tangan:
export declare function setConfirm(confirmFunction: (p1: string, p2: (p1: boolean) => void) => void): void;
Parameter
Parameter |
Jenis |
Deskripsi |
confirmFunction |
(p1: string, p2: (p1: boolean) => void) => kosong |
Fungsi yang akan dijalankan. |
Hasil:
void
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-08-22 UTC.
[null,null,["Terakhir diperbarui pada 2024-08-22 UTC."],[[["The `dialog.setConfirm()` function allows you to define a custom function that will be executed when the `Blockly.dialog.confirm()` method is called."],["This custom function receives the confirmation message and a callback function as parameters, enabling you to handle user confirmation within your application logic."],["The callback function should be used to signal the user's choice (true for confirm, false for cancel) back to the Blockly dialog system."]]],["The `dialog.setConfirm()` function sets a custom function to execute when `Blockly.dialog.confirm()` is invoked. This function, passed as `confirmFunction`, takes two parameters: a string (`p1`) and a callback function (`p2`). The callback function `p2` accepts a boolean parameter. The `setConfirm()` function itself does not return any value. Its main purpose is defining the behavior of the confirmation dialog.\n"]]