Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.

Can We Disable the Close?

cishpix

Hi....

I have a guest access like below screen

Guest-VP.png

As I want, the guest user cannot click the close button on the title bar or set the button invisible on the title bar. Can we do like that?
Thank you


ORS61

Add below code to render script of your form. This will hide all menu items in panel toolbox including close button.

$(".k-window-actions").css ("display", "none");


pureist

..but the user pressing Esc will still close it.


cishpix

ORS61 wrote

Add below code to render script of your form. This will hide all menu items in panel toolbox including close button.

$(".k-window-actions").css ("display", "none");

Very appreciate for you, it's really work. Thank you

pureist wrote
..but the user pressing Esc will still close it.

Yes, I know it but do you have any idea to prevent it?


ORS61

Use this script to disable esc key. Paste it to bottom of startup.html file just before </body>
This will disable esc key for your popups. I'm not an expert, it may have negative affects.

<script>
$(function () {
kendo.ui.Window.fn.keydown = function (originalFn) {
var KEY_ESC = 27;
return function (e) {
if (e.which !== KEY_ESC) {
originalFn.call(this, e);
}
};
}(kendo.ui.Window.fn.
keydown);
});
</script>


aware_support

If this is the process, there is a setting on the properties of the process to disallow users to cancel the process.


cishpix

ORS61 wrote

Use this script to disable esc key. Paste it to bottom of startup.html file just before </body>
This will disable esc key for your popups.

Thank you for your response. I think you're really familiar with the basic of javascript but I just think the script will effect all of other applications, is it right?

aware_support wrote

If this is the process, there is a setting on the properties of the process to disallow users to cancel the process.

Yeah... Support are right, it's the process.
I have test it before (remove the tick on 'Allow user to cancel the process' checkbox) but I still can cancel the form from 'esc' button on keyboard or click close button on the title bar of the form (if I don't use ORS61's trick).


aware_support

If you are not running the latest build - update. There was a fix for this in one of the latest builds.


cishpix

aware_support wrote

If you are not running the latest build - update. There was a fix for this in one of the latest builds.

I have test it on the latest version (build 2229) but I still can cancel the process from 'Esc' button on keyboard.


pureist

To be specific, despite any 'fix' which supposedly occurred, NOT enabling the 'Allow user to cancel process' setting for a Process ONLY has the effect of removing the Cancel Button from the popup.

It does not also (as it should according to the description of the setting) prevent the X from appearing in the Title Bar of the popup as well as presses of the the Esc key to be ignored.


aware_support

I have test it on the latest version (build 2229) but I still can cancel the process from 'Esc' button on keyboard.

This should be fixed in build 2235