How to automatically switch between modern and classic app ExtJs
up vote
1
down vote
favorite
I have a method which switch into modern version after click on button:
Ext.beforeLoad = function (tags) {
var s = location.search, // the query string (ex "?foo=1&bar")
profile;
if (s.match(/bclassicb/)) {
profile = 'classic';
}
else if (s.match(/bmodernb/)) {
profile = 'modern';
}
else {
profile = tags.phone ? 'modern' : 'classic';
}
Ext.manifest = profile; // this name must match a build profile name
};
That code set profile before load page. And I add parameter using method:
onSwitchToClassicConfirmed: function (choice) {
if (choice === 'yes') {
var s = location.search;
// Strip "?modern" or "&modern" with optionally more "&foo" tokens following
// and ensure we don't start with "?".
s = s.replace(/(^?|&)modern($|&)/, '').replace(/^?/, '');
// Add "?classic&" before the remaining tokens and strip & if there are none.
location.search = ('?classic&' + s).replace(/&$/, '');
}
}
But I want automatically switch between modern and classic screen if device is phone or tablet.
extjs extjs6-classic extjs6-modern
add a comment |
up vote
1
down vote
favorite
I have a method which switch into modern version after click on button:
Ext.beforeLoad = function (tags) {
var s = location.search, // the query string (ex "?foo=1&bar")
profile;
if (s.match(/bclassicb/)) {
profile = 'classic';
}
else if (s.match(/bmodernb/)) {
profile = 'modern';
}
else {
profile = tags.phone ? 'modern' : 'classic';
}
Ext.manifest = profile; // this name must match a build profile name
};
That code set profile before load page. And I add parameter using method:
onSwitchToClassicConfirmed: function (choice) {
if (choice === 'yes') {
var s = location.search;
// Strip "?modern" or "&modern" with optionally more "&foo" tokens following
// and ensure we don't start with "?".
s = s.replace(/(^?|&)modern($|&)/, '').replace(/^?/, '');
// Add "?classic&" before the remaining tokens and strip & if there are none.
location.search = ('?classic&' + s).replace(/&$/, '');
}
}
But I want automatically switch between modern and classic screen if device is phone or tablet.
extjs extjs6-classic extjs6-modern
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a method which switch into modern version after click on button:
Ext.beforeLoad = function (tags) {
var s = location.search, // the query string (ex "?foo=1&bar")
profile;
if (s.match(/bclassicb/)) {
profile = 'classic';
}
else if (s.match(/bmodernb/)) {
profile = 'modern';
}
else {
profile = tags.phone ? 'modern' : 'classic';
}
Ext.manifest = profile; // this name must match a build profile name
};
That code set profile before load page. And I add parameter using method:
onSwitchToClassicConfirmed: function (choice) {
if (choice === 'yes') {
var s = location.search;
// Strip "?modern" or "&modern" with optionally more "&foo" tokens following
// and ensure we don't start with "?".
s = s.replace(/(^?|&)modern($|&)/, '').replace(/^?/, '');
// Add "?classic&" before the remaining tokens and strip & if there are none.
location.search = ('?classic&' + s).replace(/&$/, '');
}
}
But I want automatically switch between modern and classic screen if device is phone or tablet.
extjs extjs6-classic extjs6-modern
I have a method which switch into modern version after click on button:
Ext.beforeLoad = function (tags) {
var s = location.search, // the query string (ex "?foo=1&bar")
profile;
if (s.match(/bclassicb/)) {
profile = 'classic';
}
else if (s.match(/bmodernb/)) {
profile = 'modern';
}
else {
profile = tags.phone ? 'modern' : 'classic';
}
Ext.manifest = profile; // this name must match a build profile name
};
That code set profile before load page. And I add parameter using method:
onSwitchToClassicConfirmed: function (choice) {
if (choice === 'yes') {
var s = location.search;
// Strip "?modern" or "&modern" with optionally more "&foo" tokens following
// and ensure we don't start with "?".
s = s.replace(/(^?|&)modern($|&)/, '').replace(/^?/, '');
// Add "?classic&" before the remaining tokens and strip & if there are none.
location.search = ('?classic&' + s).replace(/&$/, '');
}
}
But I want automatically switch between modern and classic screen if device is phone or tablet.
extjs extjs6-classic extjs6-modern
extjs extjs6-classic extjs6-modern
asked 2 days ago
a.yushko
5811
5811
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Have a look at Ext.os.deviceType property, it contains informations of the current device.
Description from the docs:
The generic type of the current device.
Possible values:
- Phone
- Tablet
- Desktop
With the information you can set the profile
var profile = Ext.os.deviceType === "Phone" ? "modern" : "classic";
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Have a look at Ext.os.deviceType property, it contains informations of the current device.
Description from the docs:
The generic type of the current device.
Possible values:
- Phone
- Tablet
- Desktop
With the information you can set the profile
var profile = Ext.os.deviceType === "Phone" ? "modern" : "classic";
add a comment |
up vote
0
down vote
Have a look at Ext.os.deviceType property, it contains informations of the current device.
Description from the docs:
The generic type of the current device.
Possible values:
- Phone
- Tablet
- Desktop
With the information you can set the profile
var profile = Ext.os.deviceType === "Phone" ? "modern" : "classic";
add a comment |
up vote
0
down vote
up vote
0
down vote
Have a look at Ext.os.deviceType property, it contains informations of the current device.
Description from the docs:
The generic type of the current device.
Possible values:
- Phone
- Tablet
- Desktop
With the information you can set the profile
var profile = Ext.os.deviceType === "Phone" ? "modern" : "classic";
Have a look at Ext.os.deviceType property, it contains informations of the current device.
Description from the docs:
The generic type of the current device.
Possible values:
- Phone
- Tablet
- Desktop
With the information you can set the profile
var profile = Ext.os.deviceType === "Phone" ? "modern" : "classic";
answered 11 hours ago
And-y
1,32821729
1,32821729
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53175811%2fhow-to-automatically-switch-between-modern-and-classic-app-extjs%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password