Fullcalendar.io How to intercept 'prev' and 'next' from the header - javascript

I'm building an app using react with typescript and now for displaying a calendar I'm using Fullcalendar.io
My problem is that I don't know how to intercept the event when you click on the header prev or next as you can see into the attached pic.
The provided solution form the library is this. But I want to know if I can use another smart solution.
Thanks in advice.

I'd like to bump this if I may (apologies if this is not allowed).
I have a similar requirement, to intercept the call to calendar.next(), or at least when the buttons are pressed (as I have no other call to the functions).
My requirement is due to a legal requirement that means I have to have text on my page be bilingual. As Welsh is not a supported locale option, I have to manually adjust the text.
I've had to do similar with Moment.js text, so piggybacking on the function I wrote for that (simple replace text function).
if (userData.languagePref > 1) {
var calMonthText = $('.fc-left h2').text();
var translatedText = translateMomentJsFromNowText(calMonthText);
$('.fc-left h2').text(translatedText);
}
This is called after the calendar is initialised, and works on the initial display, however I need to run this when the next/prev buttons are used as well.

Related

Word ribbon customization of native Office commands

I'm trying to figure out if it's possible to customize Ribbon in Word programatically using Word JavaScript API. I went through the documentation and couldn't figure it out. I'm also curious if it's even possible right now.
What I'd like to achieve is to disable one of the items within Revision Tab. There's a property on the Office object called Office.ribon, which provides requestUpdate(input) method, which should enable this kind of functionality. Although it looks like the RibbonApi is not fully supported yet in Word as stated in the documentation. https://learn.microsoft.com/en-us/office/dev/add-ins/reference/requirement-sets/ribbon-api-requirement-sets
Is there any alternative how to achieve this goal? It might be possible to do it in manifest.xml, but I'm not sure how to get the specific ID of that item. Only IDs of those top-level Tabs are documented, but not their buttons, dropdowns, etc. It also looks like it's only possible to customize only my own custom items, where I specify the ID by myself. Is it also possible to edit a state of those native Office components, like disabling a button within a Tab?
It seems like a basic operation which could already be a part of the API. Can anybody confirm that it's really impossible to do it so far or is there some kind of a workaround at least?
Thank you.
There is currently no way to programmatically change the ribbon in Word. We are working on enhanced ribbon customization, but I would not expect them to be available in Word before mid-2021 and they may not include the option of disabling a built-in ribbon button.

Windows with space to write text dont appear AJS

I have created custom Issue Tab Panel with field, where I can add comment when Ill press my custom button “add comment”
In my VM template I have
AJS.$("#add-comment-button").click(function(e) {
e.preventDefault();
AJS.dialog2("#add-status-comment").show();
});
This button works fine and window to write text appears, but… In other section in Issues --> Current Search —> Views (Detail Views), windows with space to write text dont appear when I click button “add comment”. It only appers in normal view of issue… Whats problem?
I'm not sure if I understand your question right so I'll give it a try. Maybe it helps in one or the other way.
As you didn't provide the code affecting the window I assume it is possible you are retrieving the issue key or issue id. There are some Jira JS calls that don't work in every view. The reason is unknown to me, but maybe if you use different calls it will work.
Here is the question and answer to this field availability problem on the atlassian community: https://community.atlassian.com/t5/Jira-questions/Get-issueID-in-JavaScript-in-Project-Screen-viewing-issue/qaq-p/824175
Otherwise you should provide some more information.
Regards
Chris

JavaScript to add/remove back button in Qualtrics

I am trying to use the code hidePreviousButton () to hide the back button in Qualtrics. Currently, I have added the back button on all questions using the Survey Options, and I would like to remove the back button on certain pages.
If there is not a way to do that, then I would be equally open to adding the back button on select pages using JavaScript as well.
Thank you for any assistance!
To hide the previous button, you can use:
this.hidePreviousButton ()
So the full code screen should look like this:
`Qualtrics.SurveyEngine.addOnload(function()
{
this.hidePreviousButton ()
});
`
I found this in the API Qualtrics page, but there it forgets to tell you that you need to include "this." before any of the commands that it gives you. At least, adding that code before the command worked for the ones I tried.
The API page for Qualtrics is actually inaccurate, unfortunately it needs a few updates. The current way to do this, is by adding:
$('.PreviousButton').hide();
to the JavaScript for any question you want to hide it for.

Fully custom lightbox in dhtmlxGantt

Hi there,
I'm looking at using dhtmlxgantt as a way of building up an itinerary i.e. you add items at specific days throughout a period (most likely 2 weeks)... However, there are quite a few extra variables that I need to store along with the standard info of dates etc. There are a series of 4 dropdowns which populate the next one via AJAX.
I know I can add custom controls into the lightbox but these will not work via AJAX when the previous dropdown is changed. I was hoping that I'd be able to make a fully custom lightbox which then passes everything back to dhtmlxGantt but I can't seem to find away...
It looks like it's possible in the scheduler product (http://docs.dhtmlx.com/scheduler/samples/02_customization/16_custom_form.html) can we do the same with Gantt?
Thanks in advance,
Adam.
You can just redefine gantt.showLightbox method and show your form from there. And then use public API to save changes - gantt.addTask, gantt.updateTask, gantt.deleteTask
Here is a crude example:
http://docs.dhtmlx.com/gantt/snippet/5e134aa1

Possible to read the selection of a subgrid in CRM2011?

I'm trying to be able to retreieve the selection of a SubGrid at the exact moment a user selects it. For example, add an EventListener OnClick that would make a JS function run in the background to do X thing when a subgrid element/row is selected without having to click Save or another button to run the function. Ive been searching online and alot of links appear for retrieving ALL records in a subgrid but none really show if one can add an EventListener. Another possibility would be to intercept when a subgrid is focused on and make that run a function. What do you guys think would be possible, always trying to keep the methods the supported way. :).
If your willing to be a little creative, you could try the following:
Add a custom ribbon button.
Add an enable rule to that ribbon button that calls a JavaScript library.
Add your logic into that JavaScript library.
When a record is selected in the sub grid, CRM will refresh the ribbon and call your enable rule.
I've only just thought of that so I don't know if it will work, but worth a try.
If that fails then I don't know any other supported way to have an OnClick event.
Edit, I've had a play and it does appear to be possible, see my blog post here: CRM 2013 Adding an On Change Event to a Grid View. Its for CRM 2013, but I believe can be adapted for CRM 2011 (see my note at the end).

Categories

Resources