How to disable Aria accessibility warnings in ExtJS 6 - extjs

I am migrating a big ExtJS code base from ExtJS4 to ExtJS6, and the browser console if full mit warnings like
[W] Panel panel-1017 is a region section of the application, but it does not have a title. Per WAI-ARIA, all regions should have a heading element that contains region's title.
How can I disable those warnings ? (I know accessbility is good, but I'd like to tackle after fixing the migration bugs )
I tried
Ext.enableAria = false;
Ext.enableAriaButtons = false;
Ext.enablePanels = false;
to no avail

It's Ext.enableAriaPanels, not Ext.enablePanels.
And it should work, because, if you look into the Ext code:
if (Ext.enableAriaPanels && me.ariaRole === 'region' && !title) {
Ext.log.warn("Panel " + me.id + " is a region section of the application, " +
"but it does not have a title. Per WAI-ARIA, all regions " +
"should have a heading element that contains region's title.");
}
If it doesn't work, you're setting the value too late.

Related

SOQL Query for getting the Application name of a Particular Tab

I would like to get the Application name of a specific sObject. For example: I have a custom object called Candidate__c. How to get the Application name of Candidate__c programmatically?
I am open to any approach like using Schema Namespace as well.
I am answering my question. I used Schema.describeTabs() and It works perfectly, but the Doc says the DescribeTabs method returns the minimum required metadata that can be used to render apps ...
Basically, The All Tabs are not included in the list of described tabs. The results are dependent upon the apps that are available to the running user.
// Get tab set describes for each app
List<Schema.DescribeTabSetResult> allApps = Schema.describeTabs();
// Iterate through each tab set describe for each app
for (Schema.DescribeTabSetResult oneApp : allApps) {
System.debug('The tabs/objects associated with the' + oneApp.getLabel() + ' app are:');
List<Schema.DescribeTabResult> appTabs = oneApp.getTabs();
for (Integer i = 0; i < appTabs.size(); i++) {
System.debug((i + 1) + '. Tab Name: ' + appTabs[i].getLabel());
}
}

SearchCommand in Toolbar no longer showing correctly

I noticed that after an update of CN1 some time ago, the Search doesn't display correctly in the toolbar anymore.
When you click the search icon, the toolbar will change and the icons will show, but the textfield for entering the search text (and which normally shows a hint) doesn't show up even if you start to type. It is only shown when you provoke a refresh of the screen, e.g. click in the search field or on the form.
Form hi18 = new Form("FormTitle");
hi18.setLayout(BoxLayout.y());
Container cont18 = hi18.getContentPane();
hi18.getToolbar().addSearchCommand((e) -> {
String text = (String) e.getSource();
for (Component c : hi18.getContentPane()) {
c.setHidden(c instanceof Label && ((Label) c).getText().indexOf(text) < 0);
}
hi18.getComponentForm().animateLayout(150);
});
for (int i = 0; i < 20; i++) {
Label l = new Label("Label " + i);
cont18.add(l);
}
hi18.show();
Looks fine for me considering you created a title with no text in it for the test case so it might be shrinking on you. I suggest adding text to the title and making sure your styling doesn't impact this too much. I would also suggest adding screenshots when discussing something that doesn't look right so we're all on the same page.
These were generated with your code on the current trunk:

Dhtmlxgantt how can i change the height of the Task Bars?

Hello i work with the Framework Dhtmlxgantt. And i would like to change the height of the Task Bars. They are to big for me and i would like to have id smaller. Is this possible? Because i search alot and i dont find anything about that. And i have another Problem. I have in my Database some Projects and a part of them has in the Titel html tags and the other not. The result is in the Gantt chart is the Titel field in diffrent font size what looks stupid. So is there a way to change that before id rendert on the Gantt chart or have i to change all Titel's in the Database? I hope some of you can help me. Greece
try this to set height
gantt.config.row_height = 36;
gantt.config.task_height = 20;
gantt.config.scale_height = 50;
To set task text use templates
gantt.templates.task_text=function(start, end, task) {
return "anything you want";
};
You can return task.text or task.id or "(" + task.text + " id = " + task.id + ")"
It seems to be easy )

Getting scroll position with sencha architect extjs

I have been trying to get the scroll position of a tree grid in and ext.js application using sencha architect. Originally I wanted to keep the scroll position after a reload so when a user deletes a post it will scroll back to that same spot after reload. I have attempted to use various methods I have searched for but nothing is working. I'm currently testing by having a java script timeout function give me the scroll position after a few seconds, long enough for me to scroll down and console.log the position but it gives me nothing and I'm not showing anything but zero when I go into the dom and look at the tree view object. I have already tried the following
1st: var newcompheight = comboboxeample.getHeight();
2nd: getScroll: function() {
var me = this,
dom = me.dom,
doc = document,
body = doc.body,
docElement = doc.documentElement,
left, top;
if (dom === doc || dom === body) {
// the scrollLeft/scrollTop may be either on the body or documentElement,
// depending on browser. It is possible to use window.pageXOffset/pageYOffset
// in most modern browsers but this complicates things when in rtl mode because
// pageXOffset does not always behave the same as scrollLeft when direction is
// rtl. (e.g. pageXOffset can be an offset from the right, while scrollLeft
// is offset from the left, one can be positive and the other negative, etc.)
// To avoid adding an extra layer of feature detection in rtl mode to deal with
// these differences, it's best just to always use scrollLeft/scrollTop
left = docElement.scrollLeft || (body ? body.scrollLeft : 0);
top = docElement.scrollTop || (body ? body.scrollTop : 0);
} else {
left = dom.scrollLeft;
top = dom.scrollTop;
}
return {
left: left,
top: top
};
3rd: var test = window.pageYOffset;
I have also attempted to setting the keepscroll position property in Sencha architect to true and other things I have googled but nothing is working. Any help would be appreciated.
Use this:
treeGrid.getEl().getScrollTop()

Windows Form "Jumps" when clicked

This question is regarding a Windows form built in PowerShell using System.Windows.Forms - I intend to convert it to C# at some point, just hasn't happened yet. C# contextual answers welcomed.
So in order to make this tool appear more like an "app" verses another WPF thing, the control boxes were removed, along with the title. In doing so, we lose the ability to move the form. So I decided to write a nice little number to handle that, which you all may agree or disagree with. Anyhow, it works great on my workstation, laptop, and a remote session to a few random terminal servers. However, when testing with a user, the app experiences a "jump" when clicked on where this bit of code might be picking up on the mouse click. The form's icon still shows in the toolbar, but it's obvious that the form has gone way off screen, and cannot be pulled back to center. I am not 100% sure if it's the code, but I have a feeling. I cannot reproduce this on my machines. Please don't tell me how to get the form back on the screen, that is just a workaround. I appreciate any ideas.
$GLOBAL:ButtonDown = 0
$GLOBAL:FX = 0
$GLOBAL:MX = 0
$GLOBAL:FY = 0
$GLOBAL:MY = 0
$Form.Add_MouseUp({handler_Form_MouseUp})
function handler_Form_MouseUp{$GLOBAL:ButtonDown = 0}
$Form.Add_MouseDown({handler_Form_MouseDown})
function handler_Form_MouseDown{
$GLOBAL:FX = $Form.Location.X
$GLOBAL:MX = [System.Windows.Forms.Cursor]::Position.X
$GLOBAL:FY = $Form.Location.Y
$GLOBAL:MY = [System.Windows.Forms.Cursor]::Position.Y
$GLOBAL:ButtonDown = 1
}
$Form.Add_MouseMove({handler_Form_MouseMove})
function handler_Form_MouseMove{
if($GLOBAL:ButtonDown){
#write-host ("X:"+ ([System.Windows.Forms.Cursor]::Position.X) + " || Y:" + ([System.Windows.Forms.Cursor]::Position.Y))
$newX = $GLOBAL:FX + ([System.Windows.Forms.Cursor]::Position.X - $GLOBAL:MX)
$newY = $GLOBAL:FY + ([System.Windows.Forms.Cursor]::Position.Y - $GLOBAL:MY)
$Form.SetDesktopLocation($newX, $newY)
$GLOBAL:FX = $Form.Location.X
$GLOBAL:MX = [System.Windows.Forms.Cursor]::Position.X
$GLOBAL:FY = $Form.Location.Y
$GLOBAL:MY = [System.Windows.Forms.Cursor]::Position.Y
}
}

Resources