Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to override Yii data-confirm dialog #28

Closed
kartik-v opened this issue Oct 20, 2017 · 3 comments
Closed

Add feature to override Yii data-confirm dialog #28

kartik-v opened this issue Oct 20, 2017 · 3 comments

Comments

@kartik-v
Copy link
Owner

New boolean property Dialog::overrideYiiConfirm which defaults to true. Setting this to true will override all Yii confirmation dialogs with Krajee Dialog.

@kartik-v
Copy link
Owner Author

kartik-v commented Oct 20, 2017

Resolved via updates to release v1.0.2.

@attybean
Copy link

How should this property be set?
I have tried either : \Yii::$container->set('kartik\dialog\Dialog', ['overrideYiiConfirm' => false]); or
\Yii::$container->set('kartik\dialog\Dialog', ['useNative' => true]); in base controller and they both work. What is the best practice? Can it be set in the config files? It is an extension, but documentation on modification of extensions in config files is not easy to find. Thank you for all your excellent work. @kartik-v

@kartik-v
Copy link
Owner Author

kartik-v commented Mar 13, 2019

Yes you need to do that way if you need to override the widget defaults. You can use either of the settings depending on what you need (useNative will always render the native browser dialog - while overrideYiiConfirm will just set it for the data-confirm behavior of yii).

But the recommended way to set this specific widget is to initialize the Dialog widget in your global view layout file that will be applied for all the views where you are using the specific layout.

You can then trigger the dialogs via javascript using the dialogLib krajeeDialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants