I want to use Xrm.Utility.confirmDialog but I need to edit the button's text, is it optional ? if yes, how can I do that ?
The previous version Xrm.Utility.confirmDialog does not have an option to customize the button label text. And its deprecated too.
Based on your CRM 2016 version - we don't have any supported way to achieve it.
Whereas the latest version Xrm.Navigation.openConfirmDialog is having that option to customize the button label text.
Further to #Arun Vinoth's answer, the JS to edit the button's text would look similar to:
const confirmStrings = {
cancelButtonLabel: "Cancel this change" // Cancel button text
confirmButtonLabel: "Confirm this change" // Confirm button text
};
Xrm.Navigation.openConfirmDialog(confirmStrings).then(...
You didn't specify which button you wish to edit, so both are included.
Related
I am trying to hide my SAVE vanilla button according to form state. when the form state != create the vanilla button should not display. I tried different things but nothing works:
I create a function in js that returns true if form is create state
function isHideState(){
formstate = Xrm.Page.ui.getFormType();
if(formstate == formType.create){
return true;}
else{
return false;}
}
I added a disply rule and connected it to my command that relevant to the js function :
my rule is : FormStateRule and state: Create
I connected my command to my vanilla button and yet it display even if the form is'nt in create state.
Am I missing something? it's been hours.. guidance someone?
UPDATE: to be more specific - I need the button to be seen only on create mode.
We do not need to use JavaScript here, instead of Display rule, please use Enable/Disable rule and apply the FormState rule.
Please see below image
Note: Whenever you are customizing the vanilla button (OOB Save button in your case), Make sure to start by right click the button in Ribbon workbench & click customize button/command to “retain” the OOB behavior & add your customizations on top of it.
Change this line
if(formstate = formType.create){
into
if(formstate == formType.create){
Single = is for assignment; double = is for comparison.
Update:
RibbonDiffXml follows/expects this structure in command:
<CommandDefinition
Id="String">
<EnableRules />
<DisplayRules />
<Actions />
</CommandDefinition>
There’s no direct property for rules in Button; only command can be linked.
<Button Alt="String"
Command="String"
CommandType=["General" | "OptionSelection" | "IgnoredByMenu" ]
CommandValueId="String"
Description="String"
Id="String"
Image16by16="String"
Image16by16Class="String"
Image16by16Left="Non Positive Integer"
Image16by16Top="Non Positive Integer"
Image32by32="String"
Image32by32Class="String"
Image32by32Left="String"
Image32by32Top="String"
LabelCss="String"
LabelText="String"
MenuItemId="String"
ModernCommandType=[ "ControlCommand"| "System"]
ModernImage=”String”
Sequence="1"
TemplateAlias="String"
ToolTipDescription="String"
ToolTipHelpKeyWord="String"
ToolTipImage32by32="String"
ToolTipImage32by32Class="String"
ToolTipImage32by32Left="Non Positive Integer"
ToolTipImage32by32Top="Non Positive Integer"
ToolTipShortcutKey="String"
ToolTipTitle="String"
/>
After 2013, commandbar introduction changed the behavior of Enable rule similar to Display rule. Disabled buttons using Enable rule will hide the button to utilize the space for other buttons in command bar (as there are always limitation like 7 or 9 buttons in command bar unlike Ribbon).
Enabling buttons again will act like show/hide once switched (similar to Display rule). Probably you can follow this blogpost to achieve yours.
An important thing to remember is to add the enable rule(s) to the command. This is commonly missed, someone creates an enable rule but forgets to add it to the button command.
If you forget to add enable rules to the command then the button will show on all states/stages of the form. If you forget to add the command to the button, then the button will not show up on the form.
In the ribbon editor, you can add Display and Enable rules. You can check the form type with no code. Look at this video:
https://www.youtube.com/watch?v=xyLzEAW0CJs
I've read many posts regarding the lack of documentation for button lists in CKEditor 4, and I've found posts where individuals even posted a list of button Items based on their testing.
However, what my client has asked is to remove specific buttons within the Source group - the Comment, Uncomment and HTML Tag Autocomplete buttons.
Does anyone know the correct button names for these buttons that will work with removeButtons()?
I've tested the obvious - Comment,Uncomment,Autocomplete - but they have no effect.
Thanks.
I know it is late for the OP, but for anyone interested, the default configuration for the CodeMirror plug-in toolbar is (Sourcedialog included):
{ name: 'document', items: [ 'Source', 'Sourcedialog', 'autoFormat', 'CommentSelectedRange', 'UncommentSelectedRange', 'AutoComplete' ] }
To remove specific buttons with the removeButtons() function you can add each button name to the array, so for the case in question:
removeButtons: 'CommentSelectedRange,UncommentSelectedRange,AutoComplete'
Notice the names of the buttons are case-sensitive.
For whomever stumbles upon this later on.
The buttons are added by the codemirror plugin. Codemirror has configuration to not include these buttons.
CKEDITOR.config.codemirror = {
// Whether or not to show the search Code button on the toolbar
showSearchButton: false,
// Whether or not to show Trailing Spaces
showTrailingSpace: true,
// Whether or not to show the format button on the toolbar
showFormatButton: false,
// Whether or not to show the comment button on the toolbar
showCommentButton: false,
// Whether or not to show the uncomment button on the toolbar
showUncommentButton: false,
// Whether or not to show the showAutoCompleteButton button on the toolbar
showAutoCompleteButton: false
};
I have used CKEDITOR.appendTo( "my_div" , null , my_string ) to create an instance of ckeditor ... no problem.
however, the LINK button opens a non-interactive LINK dialog box.
So, is there some config setting that it supposed to be manually set to true, perhaps?
EDIT 1 ... I will explain what I meant by non-interactive LINK dialog box ...
When I click the ckeditor's LINK button (the one that looks like a chain-link), it opens a LINK dialog box which has a input field for me to enter a URL, plus a pulldown to choose protocol, plus a couple of other form elements.
However, none of these are use-able ... if I try to type in the url input field, nothing happens (the field will not accept focus); likewise the pulldowns do not open if I click them.
EDIT 2 ... added screenshot
When the modal option is set to true for the dialog, the dialog blocks any interaction with elements outside of it. (https://github.com/jquery/jquery-ui/blob/master/ui/dialog.js#L818)
You can override this to allow interaction with elements inside ckeditor.
Just include this somewhere after jquery ui and it should work:
orig_allowInteraction = $.ui.dialog.prototype._allowInteraction;
$.ui.dialog.prototype._allowInteraction = function(event) {
if ($(event.target).closest('.cke_dialog').length) {
return true;
}
return orig_allowInteraction.apply(this, arguments);
};
If you want to allow interaction with any element outside of the dialog, include this instead:
$.ui.dialog.prototype._allowInteraction = function(event) {
return true;
};
Add this:
$(document).on('focusin', function(e) {e.stopImmediatePropagation();});
I was using:
jquery-1.8.2
jquery-ui-1.10.3
ckeditor 4.3.1
then I replaced: jquery-ui-1.10.3 with: jquery-ui-1.9.0 and it seems to work as expected.
If reverting back to jquery-ui 1.9 is not good for you, also look at:
jquery-ui forum ... "can't edit fields of CKEditor in jQuery UI modal dialog"
jquery-ui bugs ... "Dialog: CKEditor in Modal Dialog is not editable"
I am using a modal popup up control in jQuery, the popup has an input text powered by jQuery Tokenize input plugin. The problem is when i type something on modal popup text box, the search results by tokenize plugin are shown hidden under the popup. Actually they should apprear on top of all controls. Would someone please help me as I am a beginner.
Try to seek help from thread below, zindex is not working.
https://github.com/loopj/jquery-tokeninput/issues/190
here is the input control that i am using.
http://loopj.com/jquery-tokeninput/demo.html
Thank you.
It works by setting the z-index manually:
$(".token-input-dropdown").css("z-index","9999")
The function given in
https://github.com/loopj/jquery-tokeninput/issues/190
does not work in my coffeescript:
$('#book_author_tokens').tokenInput('/authors.json', {
zindex: 9999
});
I think that a better solution is to add it to the css file (instead of doing it via js):
div.token-input-dropdown-facebook {
z-index: 11001 !important;
}
Of course, drop the "-facebook" suffix if you're using the default theme.
I have successfully increased the zIndex for edit,add,del and search options but alertmod is still at z-index 950 making it always behind parent modal.
alertmod is the warning message when click edit or delete without selecting any row. Is there a way to change the zIndex for alertmod?
new code but still not working... did I place it in wrong order
$("#list-employees-grid").jqGrid('navGrid',"#list-employees-pager",{alertzIndex:3234},
{edit:true,add:false,del:true,search:true,},
{zIndex:1234}, //option for edit
{zIndex:2234}, // for add
{zIndex:3234}, // del
{zIndex:4234, multipleSearch:true, multipleGroup:true} // search
);
There are some cases where the "alertmod" can be created. For example if you mean alerts from the navGrid you can use alertzIndex option which is currently just not documented in the list of navGrid parameters. Nevertheless you can use for example the following options used by alert dialogs: alertcap, alerttop, alertleft,alertwidth,alertheight,closeOnEscape, alertzIndex. See the line of code for details.
For example you can set default value for alertzIndex by
$.extend($.jgrid.nav, {alertzIndex: 1005});
UPDATED: I posted the feature request which could solve the problem with the options of alert dialog in the common case.
UPDATED 2: The feature request is already implemented in the jqGrid code on github (see here). So in the next version (the next after 4.4.0) one will be able to use
$.extend($.jgrid.jqModal, {zIndex: 1005});
to set default z-Index for all alert messages shown by jqGrid.
Yes, there is an alertzIndex option that can be used to specify a custom zIndex. For example:
jQuery("#grid_id").jqGrid({
...
pager : '#gridpager',
...
}).jqGrid('navGrid', '#gridpager', {alertzIndex: customZIndex, ...});
This option is missing from the jqGrid Navigator documentation and should probably have an entry in the Parameters section. You can see all of the possible options in the source code if you look at grid.formedit.js and browse to the navGrid function definition at line 1702.
Does that help?