This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the platform names that are tested in Ionic Platform | |
| Platform Name | Description | | |
* |-----------------|------------------------------------| | |
* | android | on a device running Android. | | |
* | cordova | on a device running Cordova. | | |
* | core | on a desktop device. | | |
* | ios | on a device running iOS. | | |
* | ipad | on an iPad device. | | |
* | iphone | on an iPhone device. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function displayDefaultSortIcon(grid, fieldName){ | |
if(grid && grid.layout) { | |
dojo.forEach(grid.layout.cells, function(cell, idx) { | |
if(cell.field === fieldName) { | |
var targetCell = $('#'+cell.id); | |
if(targetCell) { | |
targetCell.attr("aria-sort","descending"); | |
var domToAddSortIcon = $(targetCell.find('.dojoxGridSortNode')); | |
if(domToAddSortIcon) { | |
domToAddSortIcon.empty(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<!-- Main Container to hold Grid and Navigation Pad --> | |
<div id="status"> </div> | |
<!-- To hold instance 1 UI --> | |
<div id="instance1"> </div> <br/> | |
<!-- To hold instane 2 UI --> | |
<div id="instance2"> </div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function function LoginControl() { | |
this.loginData = { username:'', password:'' }; | |
this.name = ''; | |
this.loginUI = $('<div class="login-ui"> \ | |
<form name="loginForm" class="login-form"> \ | |
<div class="form-fields"> \ | |
<label class="title"> User Login </label> \ | |
<div class="form-field"> \ | |
<input type="text" class="input-text username" name="username" placeholder="User ID"/> \ | |
</div> \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LoginControl.prototype = { | |
loginInitialize: function(placeHolder, name) { | |
var currentInstance = this; | |
var view = currentInstance.loginUI; | |
currentInstance.name = name; | |
view.children('.login-form').submit(function(event) { | |
if(currentInstance.loginData.username === '' || currentInstance.loginData.password === '') { | |
alert (currentInstance.name + ': Input fields should not be empty'); | |
} else { | |
LoginAdapter.login(currentInstance); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var LoginAdapter = { | |
loginServiceURL : 'api.yoursite.com/login', | |
loginHTTPMethodType : 'POST', | |
login : function (instance) { | |
var loginData = instance.loginData; | |
/* Client Side Processing for demonstration*/ | |
if(loginData.username === 'user' && loginData.password === 'pwd') { | |
$('#status').text(instance.name +": Succeeded"); | |
} else { | |
$('#status').text(instance.name +": Failed"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var myLoginControl = new LoginControl(); | |
myLoginControl.loginInitialize($('#instance1'), "Instance 1"); | |
myLoginControl = new LoginControl(); | |
myLoginControl.loginInitialize($('#instance2'), "Instance 2"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = { | |
foo: { | |
bar: { | |
cc: { | |
str: "Hello I'm deep" | |
}, | |
dd: "Just a level up", | |
}, | |
dd: { | |
cc: "Just another level up" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = { | |
foo: { | |
bar: { | |
cc: { | |
str: "Hello I'm deep" | |
}, | |
dd: "Just a level up", | |
}, | |
dd: { | |
cc: "Just another level up" |