ExtJS Admin Dashboard Example from the docs - extjs

I am trying to understand how things connect in the Admin Dashboard example, the register page here: http://examples.sencha.com/extjs/6.5.0/examples/admin-dashboard/?classic#register
FYI, I have read the entire docs on the quick start and the guide (which includes almost everything), and yet I find few things that I cannot connect. Maybe the docs need improvement or maybe I'm just dumb. I'll find out if its the latter.
This is the entire source code for the application: https://github.com/bjornharrtell/extjs/tree/master/templates/admin-dashboard. I am working with the classic version.
Now for the register page, the main view is this: https://github.com/bjornharrtell/extjs/blob/master/templates/admin-dashboard/classic/src/view/authentication/Register.js
My questions are:
At line 25: cls: 'auth-dialog-register'. Which means an extra css class is being added to the component. Now I searched the scss files and did not find the style definitions for this class anywhere. Since this component is the 'authdialog', I looked at this file in particular: https://github.com/bjornharrtell/extjs/blob/master/templates/admin-dashboard/classic/sass/src/view/authentication/Dialog.scss, but I cannot find 'auth-dialog-register' anywhere. Where is that class defined? Or is it not being used(in that case, bummer)
Similarly at lines: Line 42, Line 57 also, there is a class 'auth-textbox' being attached to text boxes, but I cannot find where its styles are defined.
Moving on, on line 49, for the textfield, a 'triggers' config is defined. In the docs it is here: http://docs.sencha.com/extjs/6.5.1/classic/Ext.form.field.Text.html#cfg-triggers , It really doesn't explain anything, just a bunch of code. Also on the next line in the Register.js file, on line 50, it has a 'glyphed' config inside triggers. Again, I cannot find out in the docs what it is used for. Sure the idea is clear, that it is used for a textbox trigger, but I need to be sure I know what is happening.
My next question is probably connected with the previous one. If you look at the example page: http://examples.sencha.com/extjs/6.5.0/examples/admin-dashboard/?classic#register, you see that all text boxes have an icon saying what the field is for: Email field has an email icon. How did that come? I'm pretty sure it had to do with the triggers config in my previous question. According to the documentation https://docs.sencha.com/extjs/6.0.2/guides/core_concepts/font_ext.html, I should use a 'iconCls' config, but here that is not used.
Please someone explain this. Is it reasonable to have these questions? Or should I have been able to figure them out? I am new to ExtJS and have just started learning it from 2 weeks.

1/2) Seems they are unused classes. I'll open a ticket to remove them.
3) The triggers are button like things that can be appended to the field. As it says in the docs, they are a set of configurations for Ext.form.trigger.Trigger, the options for those can be found here: http://docs.sencha.com/extjs/6.5.1/classic/Ext.form.trigger.Trigger.html
glyphed is not a config, but rather a "label" for that trigger in the field.
4) That is some custom css, applied by the classes used in the trigger.
.password-trigger,
.auth-email-trigger,
.auth-password-trigger,
.auth-envelope-trigger {
&:before{
top: 10px;
left: -18px;
position: relative;
color: $dialog-trigger-color;
font-size: 30px;
}
&.password-trigger:before,
&.auth-password-trigger:before {
content: "\f023";
}
&.auth-email-trigger:before {
content: "\f007";
}
&.auth-envelope-trigger:before {
content: "\f0e0";
}
}

Related

Limitation on defining stylesheet in reactjs native version

If I try to define a textalign with justify value in reactjs native, I get the error message that only four values are supported: auto, left, right, center. Is it possible to work around this, and define textalign with justify? Below is the sample code:
var styleTest = StyleSheet.create({
title: {
fontSize : 20,
color : 'rgb(0,0,255)',
textAlign: "justify"
}
});
Just to clarify, I see this when trying out reactjs native for ios, not in reactjs.
The above error happens when calling StyleSheet.create method which calls StyleSheetValidation.validateStyle method. I guess in order to create a non-supported CSS property, I have to do a workaround and call CSS directly. I am curious how to go about including other stylesheet properties that are not supported, in a simple way. I couldn't find documentation on this. Pointers will be very much appreciated.
I have to do a workaround and call CSS directly
It's not actually CSS, it's a description of how it should look using the terms you know from CSS. The actual implementation does a bunch of math and then conveys it to UIKit in a way it understands, similar to how browsers implement CSS.
This has been done from scratch for react-native. It's not using an existing css engine.
I am curious how to go about including other stylesheet properties that are not supported, in a simple way
As you may have guessed by the words 'math' and 'UIKit', there's no simple way to do this, and absolutely no way to do it without modifying the objc code.
I suggest creating an issue or sending a pull request if it's missing something. Not all of CSS will be supported.
Disclaimer: Minimal iOS/react-native experience, I don't know what's required to add text justification. It may be simple.

In Sencha Touch, exactly how do I change the icon in the Tab Panel to one of the existing picto icons included in Sencha Touch?

I have researched this issue thoroughly throughout Stackoverflow and have yet to find a precise answer, so here is my question.
I am using Sencha Touch 2.4. I am using its default theme, that is, the theme that you see when you first download Sencha Touch and get set up to develop in it for the first time. I am that new to Sencha.
In Sencha I am making a Tab Panel, and in the Tab Panel, I am trying to include in the tab bar one of the many nice little picto icons included in the development kit that is not included in the default theme, using the lines of code:
title: 'Transfer',
iconCls: 'photo2',
html: 'Text stuff'
In addition, all of the guidance I have read tells me to go into the appropriate .scss file for this theme and add a single line of code, like so:
#include pictos-iconmask(‘photo2’);
Obviously it seems that this line of code should be placed in Panel.scss in the tab directory in the default theme folder, but this does not work. Now I have no idea which .scss file it should be. I have since gone into every .scss file in my SDK labeled something related to my theme, such as "tab", "Panel", "all", "app", etc., and added this line of code, but the icon will not show up. I am obviously missing something. Someone please tell me, assuming the default theme, exactly which file and in which directory and on what line of code in that file do I place this piece of code known as
#include pictos-iconmask(‘photo2’);
Thank you for any help you can give.
In Sencha Touch 2.4, just include the icon (as opposed to pictos-iconmask). For example:
#include icon('photo2');
I would recommend doing this in a high level file, not a scoped file such as tab.Panel.scss. You can always narrow down your SCSS scope later on, however for debugging just toss the include into your base app.scss to ensure it works first.
You can use the following css code to accomplish your task:
.x-tab .x-button-icon.photo2:before, .x-button .x-button-icon.photo2:before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
text-align: center;
font-family: "Pictos";
content: "N"; //mention your pictos character here like i have mentioned N here
}

CakePHP - Remove asterisk from required inputs

I'm building a CakePHP application that involves forms, and I'm looking for a way to remove the asterisk from required fields. I have several input fields that are required, but I do not want the asterisk to show.
I've tried using 'required'=>false, but that makes the field optional as well as removing the asterisk. I just want to remove the asterisk; the field needs to remain required.
You could modify the css that adds that. I've made changes in my css, so I'm not sure if it's the one that comes out of the box anymore (for that matter, I don't know if you are using the one that comes out of the box), but the css that adds those asterisk(s?) on my form is
label.required:after {
color: #EE3322;
content: "*";
display: inline;
}
And you should just replace that content:"*" with
content: "";
Now, if your css isn't the same as mine, inspect the label element, and look for a similar line (it's probably using a content: "*", so you know what you have to look for).
If you want to delete the asterisks for a single view, add an inline style in the view. If it is for the whole application, delete the line in the css file.

Does CakePHP DebugKit have built-in support for changing the toolbar location?

I'm enjoying using CakePHP's DebugKit toolbar, but is there a simple way to change its location from top right to anywhere else on the screen without having to fiddle with the code?
If the answer to this question were as simple as changing the CSS from top:0px; to bottom:0px; for #debug-toolkit-bar, I'd have already done it and I wouldn't be asking a question in the first place. The answer definitely isn't documented in the ever-so-hefty 9k readme.md file found on github unless you're referring to the section on Toolbar Configuration Settings:
The toolbar has a few configuration settings. Settings are passed in
the component declaration like normal component configuration.
public $components = array(
'DebugKit.Toolbar' => array(/* array of settings */) );
That's all it says about the "array of settings" - not much help there.
It does not have built-in support for changing it's location.
OP: If the answer to this question were as simple as changing the CSS from
top:0px; to bottom:0px; for #debug-toolkit-bar, I'd have already done
it and I wouldn't be asking a question in the first place.
It is actually that simple. To change it's location, just look at the CSS for the debug-kit-toolbar and the panel-tabs and override the float-lefts to right and the position to left instead of right...etc - all simple CSS stuff.
As far as the settings, you can view any/all of it's settings by looking at the code for the DebugKit Toolbar in Github.

Can't make Stylish script site specific

I have a Stylish script on Firefox that moves the Search button on Starting Page, but the problem is that it will move the Search button on other pages, as well.
The lines
#-moz-document url("http://startingpage.com/eng/advanced-search.html?&cat=web&query=")
OR
#-moz-document domain("http://startingpage.com/eng/advanced-search.html?&cat=web&query=")
do not work. The Search button will move on any page that has it.
Any ideas to make it site-specific?
Here’s the script:
#-moz-document url("http://startingpage.com/eng/advanced-search.html?&cat=web&query="){
}
input[value="Search"] /*isolates button*/
{
position: absolute;
top: 311px;
left: 660px;
}
Firefox 3.6.14, Win 2K
General answer:
That first line (#-moz-document url("http://startingpage.com/eng/advanced-search.html?&cat=web&query=")) should work. Does it only fail because other pages are also affected or does it fail because it never fires?
Anyway, things to check:
Was the opening brace omitted? Usually those lines are like:
#-moz-document url("http://www.google.com/hl=en&q=foo&aq=f") {
Note the brace at the end (But editing for the brace on the next line is fine, too.
Are the next pages, after the Starting Page, being loaded in by AJAX? For example, Google does this. You will notice that after entering a search term, the entire page does NOT reload.
If this is the case, then Stylish will still have the overwritten styles in effect; there is no help for it in Stylish.
So, confirm the problem with your first line. It would also be good to include exact links to the target pages and the full script.
If it is an AJAX issue, then you can easily convert the Stylish script to a Greasemonkey script -- which can, with a little logic, apply styles correctly, even on Ajaxified pages. (If that is the case: mark this question answered and open a new question, providing the full Stylish script and the desired results.)
Specific Answer, based on new information from the OP:
Based on the script provided, the error is that the braces are mispositioned. Also, you should provide a namespace.
So replace the script text with:
#namespace url(http://www.w3.org/1999/xhtml);
#-moz-document url("http://startingpage.com/eng/advanced-search.html?&cat=web&query=")
{
input[value="Search"] /*isolates button*/
{
position: absolute;
top: 311px;
left: 660px;
}
}
#-moz-document url-prefix("http://startingpage.com/eng")
or
#-moz-document domain(startingpage.com)

Resources