In a Win 8 / WinJS / StoreApp - What is the recommended way to make a modal dialog that has a listview where users can select items?
For example, say I have a page with a to do list (listview). There is an app bar with a button that should open some kind of dialog from which the user can select items from previous days displayed in a listview.
I looked at the MessageDialog, but that doesn't seem to let you have a listview (or any content) inside the MessageDialog.
The other option seems to be the Flyout Control, but I haven't found a way to make it modal. Any other options?
What I would like is something like the Bing Finance application when you add a security to the watchlist. That control seems to be a MessageDialog where you can have other controls nested inside.
Thanks for any help!
If your app cannot continue without the user input then a modal dialog is appropriate. It's often times better, however, to design your user input such that the input is not absolutely required. This allows you to give the user the ability to "light dismiss" the dialog (touch anywhere outside it to make it go away).
I highly suggest the latter. In classic user input scenarios, the user was asked for a bunch of stuff at once and they felt locked in until they got it all just right. In a more modern scenario, a user is allowed to create a new widget in one touch. The widget is created with a number of defaults and the user can then go fill in the important data. Obviously the widget is not ready for "submission" (whatever that might mean in your app) until all of the required data is on it, but a user feels better being able to drop out of input mode to do some more research or whatever it might take.
So, I suggest you use a flyout for the interaction you've mentioned. If the user clicks to fly it out and then touches outside, it just disappears. If you must make it modal for some reason, then I suggest creating your own custom MessageDialog. That would really just be a matter of creating a full screen grid with three rows. The top and bottom rows would be black with partial opacity and the middle row would be your dialog. The black rows would effectively dim the background and indicate to the user that this is modal and they must respond with user input and/or a command button to dismiss it.
Hope that helps.
You can find me online at codefoster.com
Have a look at free app codeSHOW for learning Windows 8 development
I personally haven't felt very comfortable with the inline data collection flyouts. I have decided to build my own modal controls with my own grid structure layout and design.
One thing to note is if you go the custom route you will want to use data-win-options to set the placement of your modal otherwise you will get some odd keyboard behaviors with the flyout keyboard.
As a UX designer, by trade I'm carefully evaluating each of the controls and determining what works best in each scenario. Like Jeremy said above (love the show). I started by identifying how much information I intend to collect and does collecting this information on another screen interrupt my flow. So a "locked" modal which can be dismissed from a button or taping outside the modal appears to be the best approach.
<style>
.customModal
width:500px
height:375px;
display: -ms-grid;
-ms-grid-columns: 100px 1fr 100px;
-ms-grid-rows: 100px 1fr 100px;
}
.CustomModalGridTitle {
-ms-grid-column: 1;
-ms-grid-row: 1;
-ms-grid-column-span: 3;
-ms-grid-row-span: 1;
z-index: 1;
opacity: 1;
}
.CustomModalGridContent {
-ms-grid-column: 1;
-ms-grid-row: 2;
-ms-grid-column-span: 3;
-ms-grid-row-span: 1;
z-index: 1;
opacity: 1;
}
etc.....
</style>
<div class="customModal" id="customModal" data-win-control="WinJS.UI.Flyout" data-win-options="{ placement : bottom;}" >
<div class=customModalGrid>
<div class="CustomModalGridTitle"></div>
<div class="CustomModalGridContent"></div>
<div class="CustomModalGridButtons"></div>
</div>
</div>
Then I would use the grid layout tool on MS to help you construct your display grid and make it a bit more reusable: http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_grid.htm
That's the approach I have taken:). Y ou will of course need to setup your event listeners in your js to fire the customModal. Somewhere in your ready in yourpage.js
// Show the flyout
function showFormatTextFlyout() {
var myCustomModal = document.getElementById("formatTextButton");
document.getElementById("#customModal").winControl.show(myCustomModal);
}
// You may want the
If you have an outer div you can set it to 100% width and essentially mimic the Dialog control for user authentication.
Related
I am developing a custom widget on a new Sitefinity 12.2 instance. When I define some public properties on my controller as described here, my widget designer works as expected. Clicking the edit button on an instance of my widget opens up a full page editor where I can edit my properties.
However, when I define my own widget designer view (following this documentation), the result when I click the edit button is a modal that appears outside of the window above and to the left. Inspecting the element and adjusting the styles through the browser console, I am able to move the modal onscreen where it should be. The css source for the modal's position is [myDomain]/Frontend-Assembly/Telerik.Sitefinity.Frontend/assets/dist/css/sitefinity-backend.min.css?package=[myProject], which seems to be coming from Sitefinity's default code.
My questions: Is it possible for my default designer views to use the full screen editor that the auto-generated designer uses? If not, what am I doing wrong that's causing my modal to render offscreen? Surely that's not out-of-the-box behavior?
DesignerView.Default.cshtml:
<div class="form-group">
<label>This is a custom designer view</label>
</div>
DesignerView.Default.json:
{
"priority": 1
}
Turns out our custom CSS included its own definition for a .modal CSS class, which was interfering with the Bootstrap CSS class with the same name used by Sitefinity. This style was the culprit:
transform: translateY(-50%);
Removing/renaming our custom class has fixed the issue of the designer modal loading offscreen. I'd still be interested to hear if anyone has an answer for this question though: Is it possible for my default designer views to use the full screen editor that the auto-generated designer uses?
By reading the question, you are probably already thinking; Just use plain JavaScript and add:
document.getElementById('yourId').classList.add('hide');
.hide {
display: none;
}
I added similar code to my program, and I am not getting any results.
Here is a codepen for the project I'm making.
Program View: https://codepen.io/dickeddocks/full/gKNMLW
Editor View: https://codepen.io/dickeddocks/pen/gKNMLW
If you just play the game and keep clicking "attack" till the round ends, you will get an alert and the log at the bottom will disappear. If you click "attack" again, another round starts but the log from the last round reappears.
My solution to fixing this was to add an id to each <li> element and the id would change after the round reset.
Then, I tried adding these two solutions to the function which would reset the app. ('#log0' being the id I chose to give to all the list elements generated in the first round. Then, a counter variable would run making all the list elements from the next round '#log1' -> '#log2' and so on).
document.getElementById('log0').classList.add('hideLog');
document.getElementById('log0').style.display = "none";
.hideLog {
display: none;
}
But for some reason all <li> items with #log0 keep appearing
P.S I dont want anyone to read all the code in the codepen, if you know a simple solution off the top of your mind, I'll happily take that.
Update: Ive even tried using Jquery's .addClass and still no results.
BigCommerce, How to add a custom quick view button anywhere other than the one that shows on hover like in code?
<div class="ProductImage QuickView" data-product="%%GLOBAL_ProductId%%">
%%GLOBAL_ProductThumb%%
</div>
It's been 4 months since your original post so I'm not sure if you need this anymore, but others might find it useful.
In your CategoryProductsItem.html you can insert the following code
<style>.QuickView.yourClass .QuickViewBtn{background-color:transparent !important;} .Quickview.yourClass{position:relative; display:block; padding:0;}</style><div class="QuickView yourClass btn Small icon-Add To Cart" data-product="%%GLOBAL_ProductId%%" style="display:block !important; visibility: visible;">Add to cart</div>
I use this to basically give the customer the ability to change quantities in the add to cart popup(which is actually now just using the quick view one).
The QuickViewContent.html is where you could add in the product description if you wanted with
%%GLOBAL_QuickViewProductDescription%%
the visibility and block properties are important so aren't forced to hover for the button to be visible
based on the custom-player-examples im building my own player.
i used the minimal-player template.
after i set up the player like i want it to be, i started to customize the design (color.css, structure.css, standard,css)
but now i am stuck badly..
i found out that i cant change the background-color of the waveforms unless i use a webkit or the waveform.js.
the webkit should do just fine for me...
my only problem is,
i dont know how to acess the track.waveform_url in neither my index.html or *.css files.
i know its inside waveform-container div but i need the url
.wavekit{
-webkit-mask-box-image: url(**IN HERE!!!**);
background: #81D8D0;
height: 280px;
width: 100%;
bottom: 0px;
position: fixed;
}
inside my stylesheet..
sadly i cant provide a link because its only on my hard drive yet
can somebody please help me out here?
thank you verymuch
Well, this is very hacky, but after a couple of attempts I haven't found a better way to get waveform URL.
Idea is that for first play there is an event of 'ajaxSuccess' that is firing and for the next ones there is 'scPlayer:onAudioReady' event. The point being that image’s DOM is being generated by the plugin only at some point, so we need a certain “hook” like an event to know for sure the image will be already present in DOM.
$(document).bind('ajaxSuccess scPlayer:onAudioReady', function () {
// get image from DOM of player
// it will be re-set every next play
console.log($('.sc-waveform-container > img').attr('src'));
$('.wavekit').style({
'-webkit-mask-box-image': $('.sc-waveform-container > img').attr('src')
});
});
Here's working example http://jsbin.com/uhofom/2/edit (only tested in Chrome)
Custom player project is outdated and will probably not get much attention. Its current state is not very extendable from the JavaScript point of view.
My suggestion would be to use something like Audio5JS or SoundManager2 to play music and to have custom HTML and CSS UI. To get actual sounds or sets data you could query our HTTP API or use SoundCloud JavaScript SDK. Then you'd have proper object with all data including waveform API and would control the process much better.
I've been playing around with Dojo over the last couple of days.
The script below changes the background position of the list item when the mouse is over the link.
dojo.query('a[class=main-menu-link]').forEach(function(linkTwo) {
dojo.connect(linkTwo, "onmouseover", function(evt) {
dojo.query('#main-menu ul li').forEach(function(linkThree) {
dojo.style(linkThree, {
"backgroundPosition": "right center",
});
});
You can see it in action in the right hand side menu: http://www.mechanic-one.suburban-glory.com/
I'm trying to work out the best of way of giving it a smooth transition between the two states... I've been looking on the Dojo documentation page but I'm not sure what is the best way of approaching it.
Check out the Animation quickstart. You can animate css properties and select from a set of existing animation effects and easings. Chaining is possible by requiring the NodeList-fx module.