View Sencha 4
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. | |
{ |
View app.js
Ext.data.proxy.Server.override ({ | |
timeout: 300000 | |
}); | |
Ext.data.Connection.override({ | |
withCredentials: false, | |
useDefaultXhrHeader: false, | |
disableCaching:false, | |
timeout: 300000 | |
}); |
View app.js
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'); | |
} | |
} | |
}); |
View formatXml.js
/* | |
* 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 |
View app.js
if(Ext.fly('initialLoader')){ | |
Ext.fly('initialLoader').destroy(); | |
} |
View ViewController1.js
addGmap: function (googlemapcontainer, viewModel) { | |
var mapcontainer = googlemapcontainer.down('#mapcontainer'); | |
googlemapcontainer.setHidden(true); | |
// remove old map | |
if(mapcontainer) { | |
mapcontainer.destroy(); | |
} | |
// create new map |
View Usage.js
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 |
View Java8.java
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; |
View Application.js
Ext.application({ | |
. | |
. | |
. | |
// init method | |
init: function() { | |
// initialize state provider for saving component states | |
Ext.state.Manager.setProvider(Ext.create('Ext.state.LocalStorageProvider')); | |
} |
View Poller.js
Ext.define('Empty.common.Poller', { | |
singleton: true, | |
alternateClassName: ['Poller'], | |
/** | |
* Utility to poll an endpoint provided with the required parameters | |
* Mandatory parameters are : params.pollInterval, params.pollTimeout, params.success | |
* @params {Object} params | |
* |
OlderNewer