customizable date time picker in ionic2 - ionic2

I don't want to display date after selecting the date from date picker by using tag is it possible following is the code
As is in the image i don't want to display the MAR 31,2017 is it possible??
<ion-header>
<ion-icon class="moreicon" name="more">
<ion-datetime type="button" [(ngModel)]="myDate" (click)="get()"></ion-datetime>
</ion-icon>
</ion-header>

On your component page where just do as shown below.
.scss
.ios,
.md,
.wp
{
.datetime-text{
display: none;
}
}

Related

Showing star rating on Oracle Apex Classic Report

Star ratings are now a built-in item type for oracle apex forms.
But how do you display them nicely on a report? In particular on a classic report that is displaying cards.
Its not a built-in classic report column type. Would this be easier with a different type of report?
I found the answer to my question pretty well documented here: https://community.oracle.com/message/15550215#15550215
Namely the instructions:
Set the HTML Expression property on the RATING column to:
<span class="fa u-hot-text report-star-rating" data-rating="#RATING#" title="#RATING#" aria-hidden-"true"></span>
<span class="u-VisuallyHidden">#RATING#</span>
Change the u-hot-text to another utility class (if needed) to vary the colour of the stars.
Add this style sheet to the Custom CSS section of the Theme Roller:
.report-star-rating {
white-space: nowrap;
}
.report-star-rating[data-rating="0"]::before {
content: "\f006\f006\f006\f006\f006";
}
.report-star-rating[data-rating="1"]::before {
content: "\f005\f006\f006\f006\f006";
}
.report-star-rating[data-rating="2"]::before {
content: "\f005\f005\f006\f006\f006";
}
.report-star-rating[data-rating="3"]::before {
content: "\f005\f005\f005\f006\f006";
}
.report-star-rating[data-rating="4"]::before {
content: "\f005\f005\f005\f005\f006";
}
.report-star-rating[data-rating="5"]::before {
content: "\f005\f005\f005\f005\f005";
}
The star rating item type can only be used as a standalone form item or as a column in an interactive grid.
You cannot use it in a classic report or an interactive report out of the box - but it should be rather simple to just let your sql output the corresponding read only html, like this:
select
'<span class="fa fa-star"></span>
<span class="fa fa-star"></span>
<span class="fa fa-star"></span>'
as x from dual
union
select '<span class="fa fa-star"></span>' as x from dual

How to programmatically hide header and tabs in landscape mode in Ionic 3?

I have one view in portrait mode and another in landscape mode where I want to show chart and I hide tabs and header (fullscreen mode, no scrolling). My view in landscape mode would look something like this:
<div showWhen="landscape" class="chart-settings split-container">
<ion-toolbar showWhen="landscape">
<ion-grid>
<ion-row>
<ion-col col-6>
<ion-item>
<ion-label>Period</ion-label>
<ion-select [(ngModel)]="period">
//options
</ion-select>
</ion-item>
</ion-col>
<ion-col col-6>
<ion-item>
<ion-label>Won/Lost</ion-label>
<ion-select [(ngModel)]="gender">
//options
</ion-select>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-toolbar>
<div class="flexChart">
<div id="chartdiv" [style.width.%]="100" [style.height.%]="100"></div>
</div>
I use flex to fill out the page and create "fullscreen effect with no scrolling".
Thanks
Well it seems there is this:
http://ionicframework.com/docs/api/platform/Platform/
It has:
isPortrait()
isLandscape()
so you can do:
platform.isPortrait() or platform.isLandscape()
if you inject platform into constructor.
Combine this with *NgIf:
https://angular.io/guide/template-syntax#ngif
CSS overflow, overflow-x, overflow-y is what you'd look to for prevent scrolling provided it's a block level container:
https://developer.mozilla.org/en/docs/Web/CSS/overflow
UPDATE
Based on this comment:
That was my initial thought. The problem with this is that it leaves
padding on top. I solved it by configuring styles, but it seemed
pretty dirty solution to me
You can fix that padding issue by getting the instance of the Content and call the resize() method like this:
import { Component, ViewChild } from '#angular/core';
import { Content } from 'ionic-angular';
#Component({...})
export class MyPage{
#ViewChild(Content) content: Content;
public yourMethod(): void {
this.content.resize();
}
}
https://ionicframework.com/docs/api/components/content/Content/#resize
Tell the content to recalculate its dimensions. This should be called
after dynamically adding/removing headers, footers, or tabs.
You can check landscape or portrait with platform, then you can get the ref of nav from template:
<ion-header>
<ion-navbar #navBar>
...
</ion-navbar>
</ion-header>
and call setHidden(true) in component with its ref:
#ViewChild('navBar') navBar: Navbar
// call in proper place
this.navBar.setHidden(true)
for tabs, I think you can do in the same way

How to disable toolbar-background for some ion-navbars?

My app is in cordova, ionic 3.2. I want global style for ion-navbar component. So I declared style with .toolbar-background in variables.scss file. Now the style of ion-navbar in all pages are changed. its working fine. Now I want to disable the style for a specific ion-navbar only. Can anybody help me on how it possible please?
eg:
I have below code in variable.scss;
.toolbar-background{
background-color: red !important;
}
I have below code for header in app.html page(for left side menu header);
The background of this toolbar is red.
<ion-header>
<ion-toolbar>
<ion-title text-center>
Hellow!
</ion-title>
</ion-toolbar>
</ion-header>
Below is the code for footer in the app.html;
The background of this toolbar is red. I do not want red color only for this component. How to disable this style that showing due to toolbar-background?
<ion-footer>
<ion-navbar secondary >
this is the footer
</ion-navbar>
</ion-footer>

How to create custom full screen modal in Ionic2

I want to create custom Full screen Loader component in Ionic2. But my modal div do not cover the header/navbar area. I want it to be like Ionic LoadingComponent covering everything in my app and also have my template variable. Please have a look at image.
My modal css is
#modal{
width: 100%;
height:100%;
position: absolute;
z-index: 100;
background: red;
top: 0px;
left: 0;
}
Please help.
EDIT
My ModalPage has navbar
<ion-header>
<ion-navbar primary>
<button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
EDIT
I found a workaround for this. I just use Ionic2 Popover, Popover gives 100% width+height, full screen. I called the modal popover on button click and dismiss it on 100% download.
You don't need that style rule to make the modal be fullscreen. Please take a look at this plunker.
Like you can se there, the HomePage contains a navbar, but the ModalPage html code is just
<ion-content></ion-content>
With that, and just changing the background-color
ion-page.modal-page ion-content {
background-color: red;
}
The modal should be fullscreen, without showing a navbar.

SharePoint 2013 - How do I add a button to a page that opens a list form when pressed?

I am currently working within SharePoint 2013 and was wondering if there was a way to create a button on a home page that when pressed, opens a list form in a modal window? (or in a non modal window).
I understand the method of using "Embed code" to code a button; however, it doesn't seem to allow me to link it to a list form, or edit what the button actually does.
Example:
1. An employee lands on the home page and wants to initiate a Purchase Request through the company.
2. The employee clicks on a button labeled "Click here to submit a Purchase Request".
3. After clicking, the Purchase Request form opens from the Purchase Request list (pre-created).
Thank you for your assistance!
You can use something like this in a CEWP to redirect to the new item form:
<button onclick="formRedirect(); return false;">New Form</button>
<script>
function formRedirect() {
window.location = "/test/Lists/LinkList/NewForm.aspx"
}
</script>
To display it in Modal form you will need to use the NewItem2 JS function:
<button onclick="NewItem2(event, "https://Your.SP.Site/_layouts/15/listform.aspx?PageType=8&ListId=%7B59E6FE0C%2D02C6%2D4B00%2D9B6A%2D87116A2DF594%7D&RootFolder="); return false;">New Form</button>
To get this to work you will need the list web part on the page where the button is located, though it can be hidden from view by setting th chrome to none and minimizing it. You can copy the function from the new item button in the list you wish to display, it is stored as an 'OnClick' property.
I know I am late to this but I just figured how to do this for the "Upload Document" for a document library. It took me a while but I stumbled upon it through trial and error using F12. I will provide both script for a "LIST and LIBRARY" form.
FOR A LIST:
<a href="#" onclick="openDialog('YourSiteURL/Lists/YourListName/NewForm.aspx');">
<img src="YourSiteImageURL" alt="NameofYourImage">
</a>
<script>
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'NameofYourForm', /* Enter the name you want for your form */
allowMaximize: false,
showClose: true,
width: 1225, /* Modify for your needs */
height: 800 /* Modify for your needs */
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</script>
FOR A LIBRARY:
This is for use with a button:
<a class="ms-addnew" id="idHomePageNewDocument" onclick='NewItem2(event, "YourSiteURL/_layouts/15/Upload.aspx?List={YourListID}&RootFolder="); return false;' href="YourSiteURL/_layouts/15/Upload.aspx?List={SameListID}&RootFolder=" target="_self" data-viewctr="702">
<img src="URLforYourButtonImage" alt="NameofYourButton">
</a>
This is for use with text:
<a class="ms-addnew" id="idHomePageNewDocument" onclick='NewItem2(event, "YourSiteURL/_layouts/15/Upload.aspx?List={YourListID}&RootFolder="); return false;' href="YourSiteURL/_layouts/15/Upload.aspx?List={SameListID}&RootFolder=" target="_self" data-viewctr="702">Add document
</a>