Modal Close Event via User Trigger - bootstrap-modal

How do I check if the bootstrap close/hide via user trigger or hidden programmatically?
$(modalSelector).modal('hide');
Does bootstrap has an event to detect if the modal closed via user trigger or programmatically? Because I want to have two different action for both event.
Thank you~

In order to manually show the modal pop up you have to do this
$('#myModal').modal('show');
You previously need to initialize it with show: false so it won't show until you manually do it.
$('#myModal').modal({ show: false})
or
$('#myModal').modal('hide')
Where myModal is the name of the modal container.

Related

How can I refresh and show/hide buttons in Buttons Container in Modal Dialog in Oracle APEX based on an Item Value?

In Oracle APEX 22.1 (Oracle Database EE 21c) I have a Modal Dialog Box which has a button container with several buttons. These buttons are being shown or not, based on a item in dialog box variable that is 0 or 1.
When I press the button "UnDelete", a Dynamic Action of PL/SQL execution type is fired, change the value of a field in the database and then two another Refresh True Actions follow. The PL/SQL execution type changes the value of the field in the database of a table successfully and the first dynamic Action refreshes a Classic Report Region on the Modal Dialog Box showing the new correct value of the field.
The second Refresh True Action tries to Refresh the Button Container Region of the Modal Dialog Box in order to hide the button "UnDelete" and show the rest buttons, which all are Server Condition based on this variable value. The Refresh does not take place(maybe the Button Container Region does not support the Refresh Event or does not propagate it to its Buttons)?
How can I achieve this effect?
Thanks In Advance!
I tried the Refresh Action for the Button Container Region of the Modal Dialog Box,but the buttons are not shown/hide accordingly.
"Refresh" is not relevant for a button container. The "refresh" action in apex does an ajax call to refresh the content of a report - it just re-renders a part of the DOM containing data. Currently only the data rendered by a component can be refreshed using partial page refresh. A button can never "refreshed", it is rendered in the page rendering process and from then on it lives in the DOM for the lifespan of the page.
A server side condition is evaluated at page rendering time. If a server side condition yields false at page rendering time, the component is not included in the dom. So, they cannot be shown using a dynamic action afterwards (because they're not in the dom) and they cannot be re-evaluated using a dynamic action (because the dynamic action can only manipulate the dom and that condition was evaluated before the dom was rendered).
The solution to you problem is to use show/hide actions in a dynamic action for each of the individual buttons for the reasons explained above.

Is there any button click event in Sitecore Tracker in version 9.1

I am looking for a personalization event that have to occur when a click event takes place.
No, there is not and you have to track your button click event on the server side in Sitecore.
Add an onclick() JavaScript event to your button to make the server call and pass details about the clicked button. Then register the click event as a Goal on the server side.
You can create a Goal and then trigger it as a pre-built Sitecore event using
the Sitecore.Analytics.Tracker.Current.CurrentPage.RegisterGoal() method to register your Goal against the current page as follows:
var goalId = "{Your Goal ID}"; // ID of your goal
var goalDefinition = Sitecore.Analytics.Tracker.MarketingDefinitions.Goals[goalId];
Sitecore.Analytics.Tracker.Current.CurrentPage.RegisterGoal(goalDefinition);
Read more about the pre-built events in Sitecore here.

Retool: Action button to open modal with container

I have a table in retool. I've added an "action" column with buttons and renamed them "edit". What I would like to do on click of the action button is to open a modal with the data in the row populated. A user should be able to see the values of the row, edit them and when he clicks "submit" it will send an update API call for that row's unique id.
We’re working on some new docs for modal components, but until then here’s what you can do:
Drag a modal component onto your canvas. It’s going to appear as a button that opens a model, but don’t worry about that just yet
Create a Javascript query in the query editor that opens the modal. If we’re working with the default names, your query would be modal1.open()
Configure the action button in your table to run that JS query on click
That’s a quick way to open a modal through an action button. In terms of what’s in that modal, you can drag any components you want and reference table properties. So if you wanted to display a user’s email, you could drag a text component into the model and set its value to table1.selectedRow.data.email.
The last thing to deal with is the button, which you probably don’t want since you’re opening the modal via action buttons. You can hide it by clicking on it, heading to the inspector in the right sidebar, and scrolling down to the “display” settings. Just put true into the “Hide when true” field and the button won’t show.
hello stack overflow family this is my first post.
we are facing same issue today so i used one trick for opening a modal in action, i run one query that query name is model_open and in success event i select modal open and this query is triggered in Action edit option ,
i hope my first post help you ... :)

How do I replace one Bootstrap modal with another modal via a link in the first modal?

When a user clicks a button on my site, they are prompted to sign up for our service. This prompt appears via a Bootstrap modal. But it's possible that the user will already have an account, in which case I want them to be able to log in. I want to add a "log in" link within the modal that when clicked will close the "sign up" modal and open a new "log in" modal on the same page. How would I do this?
You need to add a click event to the login button and trigger two actions.
1. Target the register modal by its ID and add the toggle option of the modal method to it. This will check the current state (in this case 'opened state') and activate the reverse.
2. Target the login modal and attach the show option of the modal method to it as shown below.
<script>
$(document).on('click', '#id_login_button', function(){
$('#id-to-register-modal').modal('toggle');
$('#id-to-login-modal').modal('show');
return false;
})

ember.js: catching url enter event

In ember.js I need to trigger a modal box create when I enter inside an URL, and to trigger its destruction when i leave it.
Do you know what events i can observe?
Will they be triggered in the controller or in the route?
And, finally, where can i find the documentation for this? I couldn't find any in ember.js site
I tried the enter and leave event, but they are triggered only once, and in the wrong moment
Thanks in advance
Look at activate and deactivate hooks on the Ember.Route.
http://emberjs.com/api/classes/Ember.Route.html