I am using the high charts.And these all have the buttons for export to .PDF on each chart.i want to a another button apart from these buttons.When I click on this button, it export all the high chart in single PDF file. And my whole code in c#
You can add override button by prepare your own buttons by exporting / buttons parameter
http://jsfiddle.net/fXHB5/8617/
exporting:{
buttons:[{
enabled:true,
align:'right',
symbol:'triangle',
onclick:function(){
alert('aaa');
}
}]
},
http://api.highcharts.com/highcharts#exporting.buttons
Related
I updated this question. What I'm trying to do:
Click add video, modal box appears.
Select MP4 and add MP4 to the modal box.
Click the "Add" button, dismiss modal box and continue test.
Issue: after Cypress adds the MP4, cypress tries to do a .click() on the "add" button. But for an unknown reason to me, the "add" button does not dismiss the modal box, blocking part of the page, Cypress can't verify the next step, causing my test to fail.
newStoryPage.getAddVideoToStory().click({force: true}) //this clicks the add video button.
cy.wait(2000)
//here I add the video to the modal box:
cy.fixture('sample-mp4.mp4','binary').then(mp4 => {
const files = [
{ fileName: 'sample-mp4.mp4', fileContent: mp4, mimeType: 'video/mp4', encoding: 'utf8' }]
cy.wait(2000)
newStoryPage.getDragAndDropFiles().attachFile(files, {subjectType: 'drag-n-drop', events: ['dragenter', 'drop'] })
})
//here I click the add button, which won't do anything
newStoryPage.getAddButton().click()
This simply isn't possible. You can't test a real file picker with Cypress. The file picker is part of the operating system user interface, which can't be tested with Cypress / isn't accessible to the browser. You just have to "trust" that the OS is doing the right thing, and test that your app is doing the right thing when presented with a File.
I have a gallery component that uses the current window size to determine how large to make the gallery items. I've also hooked the window resize events so that the gallery items are resized correctly as the window is resized.
In Chrome, if a user then prints the gallery, the items are not being resized to fit the printed page. Instead they are just using the last size calculated for the window size. This is true even when switching from portrait to landscape in the print options.
Is there any way to force react to re-render components when the print dialog is being opened and when the page layout is switched from portrait to landscape? I thought the print dialog would re-render the page with the new dimensions but that doesn't seem to be the case.
When you print a page, the browser takes a snapshot of the current DOM and applies the print media styles. Your problem is the elements on your DOM are dependent on the dimensions of the screen.
Window resize events will help to rearrange your components when the user resizes their screen but they are not triggered when the user prints. There are however ways in which you can listen to an event when the user prints the page.
window.onbeforeprint will trigger when the user prints the page. On event you either resize the screen to make the window resize events trigger or re-render your components some other way. It is not supported in chrome although take a look at this stackoverflow post, it explains how you can use window.matchMedia('print') instead.
It's always best to depend on css media queries rather than on the screen dimensions and resize events, but sometimes that is not always possible.
Use media query to target portrait and landscape print
#media print and (orientation: landscape) {
/* landscape styles */
/* write specific styles for landscape e.g */
h1 {
color: #000;
background: none;
}
nav, aside {
display: none;
}
}
#media print and (orientation: portrait) {
/* portrait styles */
}
In addition the WitVault's solution, I've created a simple React Component that makes handling complex print.css much easier. Instead of adding classes, IDs, etc. all over your markup and creating a complex print.css file, you can use my react-print library as follows:
https://github.com/captray/react-print
Add this ID to the root (or somewhere high up in your DOM tree) of your current content (but inside in the body tag)
<div id="react-no-print">
Add a div with the id of 'print-mount', or whatever mount ID you'd like to use.
<div id="print-mount"></div>
Create the structure you want for your printable version (which can include child components with their own styles to make things easier.
var PrintTemplate = require('react-print');
var ReactDOM = require('react-dom');
var React = require('react');
var MyTemplate = React.createClass({
render() {
return (
<PrintTemplate>
Your custom HTML or React Components go here, and will replace the existing HTML inside of the "react-no-print" ID, and instead it will render what's inside of your custom template.
</PrintTemplate>
);
}
});
ReactDOM.render(<MyTemplate/>, document.getElementById('print-mount'));
Basically, this renders your printable version, but it's hidden until it's needed for printing. If you need this for a sliding gallery, you probably want to hook into the change event for your slider and re-render (unmount the old one, mount the new one) the print template.
Hope this helps!
You will need to use matchMedia API in your component. But doing it yourself, you will be re-inventing a whole lot of the wheel. It'd be easier to use an existing library which takes care of this. Please check out https://www.npmjs.com/package/react-responsive. It has React based wrapper components over matchMedia, so you should be able to quickly prototype it in your project. There are polyfills available too. One other advantage I can think of is that you can have a print-preview option in your interface where you can let the user preview how the gallery will look in print mode. For this you can use the server rendering feature of this library to simulate print mode.
PS: I am not affiliated with this project in any way.
tooltipScreenShot
XSP.openTooltipDialog("#{id:tooltipDialog1}",'#{id:button1}')
How does it work on SSJS? If a function returns false, this tooltip dialog has to appear next to the button. I believe this tooltip should be close to the button.
It appears bottom left corner
All these commands below don't work:
facesContext.getViewRoot().postScript("XSP.openTooltipDialog('#{id:tooltipDialog1}')");
facesContext.getViewRoot().postScript("XSP.openTooltipDialog('#{id:tooltipDialog1}','#{id:button20}')");
view.postScript("XSP.openTooltipDialog('#{id:tooltipDialog1}');");
Use getComponent("tooltipDialog1").show(). The syntax for opening tooltip dialogs in SSJS is the same as for normal dialogs, see XPages Extension Library pp156-162.
setFor() is available via SSJS only.
I'm working with Titanium Studio 2.1 and developing for iOS 5.1, we're working on an app that shows a popover for displaying a selected image, the image can be chosen when you press a button and a dialog is shown, in said dialog one can choose to pick an image from the gallery or to take a new one from the camera.
When choosing the image from the gallery, the usual popover gallery is shown and the image can be picked with no problem. However, when the camera option is chosen, the camera interface is shown, but the popover we opened to display the image is being shown on top of the camera interface. Then if we try to take the picture, the popover is hidden because we pressed outside of the boundaries of the popover.
I would like to make it so the popover doesn't appear in front of the camera interface and disappear when taking the picture.
Is there a way to do this?
Thanks for any help you can provide.
Are you setting autohide: false in your call to showCamera? You need to showControls: false, autohide: false, and then call Ti.Media.takePicture() to take a picture.
http://docs.appcelerator.com/titanium/latest/#!/api/CameraOptionsType-property-autohide
I found a way to show the camera on a popover, that way it won't go full-screen and when clicked make the other popover to hide.
Here's the code:
Ti.Media.showCamera({
inPopOver: true, // set this to true
popoverView: btnCamera, // "view" for the pointer arrow direction
success: function (event) {
alert('success');
},
cancel: function () {
alert('cancel');
},
error: function (error) {
alert('error');
},
saveToPhotoGallery: false,
allowEditing: false,
mediaTypes: [
Ti.Media.MEDIA_TYPE_PHOTO
]
});
This is great since the camera on full-screen on the iPad looks bad.
I have the following code snippet for creating an input field for entering colors:
DataSourceTextField colorField =
new DataSourceTextField(ZoneDto.ATTR_COLOR, "*localized name*", 7, true);
colorField.setEditorType(new ColorPickerItem());
colorField.setPrompt("*localized instructions*");
This works quite well, since the input field has the localized instructions in its tooltip, but the small square that opens the color picker window has the original english tooltip ("Click to select a new color").
How could I change this message to a localized one?
Is this even possible to accomplish? I read that setEditorType only sets a template, from which instances are generated whenever needed. This means it's not going to work if I add setPrompt("localized instructions") to the ColorPickerItem given to the setEditorType().
Thanks in advance!
If i get you right, why not fill a variable 'localizedStringForColorPicker' with the current selected localization upon startup. And change it, when another localization is selected?