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
Ext.Ajax.on({ | |
requestexception: function(dataconn, response, options) { | |
console.dir(dataconn); | |
console.dir(response); | |
console.dir(response.status); | |
if (response.status === 401) { | |
me.redirectTo('login'); | |
} | |
} | |
}); |
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
Ext.data.proxy.Server.override ({ | |
timeout: 300000 | |
}); | |
Ext.data.Connection.override({ | |
withCredentials: false, | |
useDefaultXhrHeader: false, | |
disableCaching:false, | |
timeout: 300000 | |
}); |
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
if(Ext.fly('initialLoader')){ | |
Ext.fly('initialLoader').destroy(); | |
} |
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
Create a function init under Application and add the below code to initialze a state provider to store states of different components | |
in the browser's local storage. | |
// initialize state provided for saving component states | |
Ext.state.Manager.setProvider(Ext.create('Ext.state.LocalStorageProvider')); | |
Add the below two configs to the component you want to save the state for. | |
{ |
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
addGmap: function (googlemapcontainer, viewModel) { | |
var mapcontainer = googlemapcontainer.down('#mapcontainer'); | |
googlemapcontainer.setHidden(true); | |
// remove old map | |
if(mapcontainer) { | |
mapcontainer.destroy(); | |
} | |
// create new map |
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
onMenuPanelRenderer : function() { | |
var hasWebRole = User.hasRole(Config.role.web); | |
var hasAdminRole = User.hasRole(Config.role.admin); | |
if (hasWebRole) { | |
// set mentu item visible true based on role | |
} | |
if (hasAdminRole) { | |
// set mentu item visible true based on role |
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 app = angular.module("myApp", []); | |
app.directive("moveNextOnEnter", function() { | |
return { | |
restrict: "A", | |
link: function($scope, element) { | |
element.bind("keyup", function(e) { | |
if (e.which == 13) { | |
var $nextElement = element.next(); | |
if($nextElement.length) { | |
$nextElement[0].focus(); |
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
/* | |
* Utility method to format an xml string | |
* text : xml String | |
* step : no of spaces for indentation | |
*/ | |
formatXml : function(text,step) { | |
function createShiftArr(step) { | |
var space = ' '; | |
if ( isNaN(parseInt(step)) ) { // argument is string |
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
package com.practice.test; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Objects; | |
import java.util.Optional; | |
import java.util.function.Predicate; | |
import java.util.stream.Stream; |
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
Ext.define('App.controller.MainController', { | |
extend: Ext.app.Controller, | |
routes: { | |
'home': { | |
before: function(action) { | |
Ext.Ajax.request({ | |
url: Config.endpoints.user, | |
method: 'GET', | |
scope: this, | |
failure: function(data, operation) { |
OlderNewer