Foundation 6 off-canvas disable close if user click on a link - zurb-foundation-6

How and where I need to set the data-close-on-click params in my off-canvas to avoid the menu to close when user click on a link inside the menu?

Using jquery:
$('#yourDatePickerID').click(function(e)
e.stopPropagation();
e.preventDefault();
});
Depending on which date picker you are using this may or may not work. It may even not allow you to open the calendar image. If it doesn't work I suggest you look into what event for your date picker is fired when the ok button is clicked. Attach this code to that event instead of the click event and try again.

Related

xpages extension library dialog update data table

I have a xpages page that has a data table in a panel that calls an extension library dialog whose function is to create documents that are displayed in that data table. I would like to know if there is any way to by pressing the button to close the dialog refresh the data table with the new documents created.
I've used what's mentioned here to achieve that in the past:
XPages:dialog box refreshing a panel on close
Use a parameter in the .hide method to specify a control to refresh when closing the dialog. https://www-10.lotus.com/ldd/ddwiki.nsf/xpDocViewer.xsp?lookupName=Domino+Designer+XPages+Extension+Library#action=openDocument&res_title=Modal_dialogs_ddxl853&content=pdcontent
I was able to close the dialog box and update the data table as follows:
In the onClick event on the client side, and I put the code:
Dijit.byId ("# {id: dialogboxname}"). Hide ("panelWithDataTable")
And in the onComplete event of the button I use the code below:
Var idPanel = '# {id: panelWithDataTable}';
XSP.partialRefreshGet (idPanel)

Chrome Extension, trigger click on the icon

I searched on Google and StackOverflow, and I was not able to find a solution to my problem (to my greatest surprise).
I'm looking to display the popup, exactly like when the user click on the icon of my extension, but via javascript.
The idea behind it is simple : On a specific page, I inject a button and add an event listener on it ("click"). When the user click on that button, I'd like to display the tooltip, simple as that :)
... but I can not find anything related to it. Any idea ?
Thank you in advance.
Opening the popup is impossible without user interaction. For good reason too, remember that no one likes popups that open themselves. What you can do is inject your popup onto the site the user is at, through a content script.
https://developer.chrome.com/extensions/content_scripts
As per your description,
On a specific page, I inject a button and add an event listener on it ("click"). When the user click on that button, I'd like to display the tooltip, simple as that :)
I think what you need is just chrome.pageAction, it's similar to browserAction, while represents actions that can be taken on the current page, but aren't applicable to all pages.

Dynamic CRM 2011. Hide/show tabs using radio buttons issue

I have this code that hides tabs and shows tabs in CRM 2011. By default all tabs are hidden, but when the client has the product purchased (yes selected), the tab is showen.
The issue I am having is when I click yes and save & close. Then reopen the account, the tab is hidden, but the option is still yes.
The code is:
function showTab(tabNumber, optionField, optionValue) {
if (Xrm.Page.getAttribute(optionField).getValue() == optionValue) {
Xrm.Page.ui.tabs.get(tabNumber).setVisible(true);
}
else {
Xrm.Page.ui.tabs.get(tabNumber).setVisible(false);
}
}
The option I have is:
2,"new_server",'1'
I got the code from this place:
Show a Tab Dynamics CRM 2011
I am still working on this.
You need to register this function on both the form's OnLoad event and the field's OnChange event. It sounds, from your description, that it is registered and working for the OnChange event but the OnLoad event.
You currently have the function registered on the onChange event for the radio button control.
Additionally, you need to register an onLoad event for the form.
Create a new web resource.
Open Form Properties.
Add form to available resources.
Add event handler onLoad, and call your webresource.
In the web resource you can just have a call to your showTab function.
When you open the form for customization, look at the top ribbon of the form. You will see Form Properties icon right next to Preview. Click on Form Properties and then add the JavaScript web resource in the Form Library.
Choose Event: OnLoad from the drop down and then click add under the Event Handler.
Choose the web resource of your choice, add the function name being used in your code (showTab).
This will add the function to your Onload event of the form.

How to identify a button click in coded UI Customised code

In UIMAP.CS file in both the Recorded method and assertion method, I am not able to identify the button click.
Is there any way I can get hold of the button click event?
I am able to get hold the button in to a UITESTCONTROL variable but the options I was able to see are "exists", "enabled","name" etc...
I tried checking it with assertions too when I dragged the cross hair on to the clicked button , assertions are generated only for checking the existence,correctness of text and name but not the events occured on it..
Please help in this regard..
Please make sure that the Control/Object on which you want to use the Click operation is a button and not any Web Element or control which does not support the Click operation.
Once verified, you can do the following:
Record a New Session and while recording click on that button, stop your recording.
Open the UIMap.cs and navigate to that button control. The intellitrace would show you all the available options for that control.
Thanks
Nikhil

How to prevent auto-closing in jquery mobile dialog

I am trying to use Jquery Mobile's dialog. On the documetnation, it says that diaglog would be closed if a user clicks any links on a dialog page.
Documentation:
"When any link is clicked within in a dialog, the framework will automatically close the dialog and transition to the requested page, just as if the dialog were a normal page. To create a "cancel" button in a dialog, just link to the page that triggered the dialog to open. This pattern of linking to the previous page is also usable in non-JS devices as well."
How do I prevent it?
Don't use an <a> tag, use a <div>
<div id="my_button" data-role="button" data-theme="a">Don't Close</div>
Then you just have to programmatically attach some actions to the clicking of that div
$('#my_button').live('click', function({
// do something
}
If you add a function to onclick, that will override the default behavior. Just leave href="#" in the tag, put the function like onclick="myFunction()" and you should be good.
Then in the function you can do the close with this: $('.ui-dialog').dialog('close')
Or you can obviously navigate to another page with: $.mobile.changePage('#page')
I'm sure you've moved on by now, but hopefully this can help someone else looking for this solution.
wom's solution is good, but you don't need to change from tag to . You just need to change href like href="#" as Mar said. I have test like this, it works fine.
And if still can't prevent default action, add e.preventDefault() on button's click handler.

Resources