Drupal 8 Menu Item child of a Task - drupal-8

For my custom Drupal 8 (8.7.8) module, I have the following ...
my_module.reports:
route_name: my_module.reports
title: 'Reports'
base_route: my_module.dashboard
weight: 80
in my menu system in my_module.links.menu.yml and it appears as a tab on my dashboard I'm building. On that page, the route controller I have is...
_controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
I'm hoping to make there a list of further links to reports. But this (from my_module.links.menu.yml) ...
my_module.reports.territories:
title: 'Territories'
description: '...'
route_name: my_module.reports.territories
parent: my_module.reports
weight: 10
Doesn't show up. All I get when I go to that page is:
"You do not have any administrative items."
What am I missing? Is it somehow not possible to make children of tasks in this way or is this something else?
Thanks!

Finally worked it out. I had to ALSO add ...
my_module.reports:
title: 'Reports'
parent: system.admin_config
route_name: my_module.reports
... to my_module.links.menu.yml. I could then leave the link in my_module.links.task.yml as well to create the final thing I wanted.

Related

How do I get a custom button to redirect me to a page in apex oracle?

I have created the following button for an interactive grid (IG) using JavaScript Initialization Code in the IG attributes section.
function(config) {
var $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
lastToolbarGroup = toolbarData.toolbarFind("actions4"),
assembleButton = {
type: "BUTTON",
hot: false,
icon: "fa fa-send u-info-text",
iconBeforeLabel: true,
action: "assemble-as"
};
lastToolbarGroup.controls.push( assembleButton );
config.toolbarData = toolbarData;
// this is how actions are added
config.initActions = function(actions) {
actions.add({
name: "assemble-as",
label: "Assemble as ...",
action: function(event, focusElement) { apex.event.trigger("#hiddenAssembleAsButton", "hidden_assemble_as_button_click"); }
});
}
return config;
}
Then I created the hiddenAssembleAsButton using that name as the Static ID under advanced.
The button is defined by a dynamic action Hidden_Assemble_As_Button_Click which is where I think I should be able to redirect the page, but I'm not sure.
It seems like the page redirect should happen in the jQuery Selector but I don't know what to put there or if that's the correct area to add the code.
I can add images if necessary but I feel like I've described this pretty well.
Sometimes, you need a button somewhere in the interactive grid, but you still like to use the declarative options APEX provides with basic buttons, like doing all the stuff like passing variable values, calculating checksums or opening a dialog when your target page is a model page. This can be difficult in pure javascript.
In this case, you can also just create a basic button, set it up all the way you like in the designer, then hide it using Advanced --> Custom Attributes: style="display:none". Also, set a static ID like button1.
Then, in your action, you can simply trigger a click on the button.
actions.add({
name: "assemble-as",
label: "Assemble as ...",
action: function(event, focusElement) { $('#button1').click(); }
});
Clicking the button does something. It triggers an event called hidden_assemble_as_button_click binded to an id #hiddenAssembleAsButton. You want it to redirect. The simplest option is to do the redirect right in that code. Replace the actions.add block with this one:
actions.add({
name: "assemble-as",
label: "Assemble as ...",
action: function(event, focusElement) { window.location.href = "http://www.stackoverflow.com"; }
});

Drupal 8: Create a custom panel (tab) on the configuration page

Tell me how can I create a custom panel using a custom module (and yml files) on the configuration page and put an arbitrary link there?
Example panel (tab)
Did it:
# Register a tab on the configuration page
name_shower.admin_config_panel:
route_name: name_shower.admin_config_panel
title: 'My Custom Panel'
parent: system.admin_config
description: 'It is my custom panel'
weight: -5
url: internal: #
# Add link
name_shower.admin_index:
title: 'Name shower settings'
description: 'Settigns for module "Name shower"'
parent: name_shower.admin_config_panel
route_name: name_shower.admin_index
weight: 0
url: internal:/admin/config/name_shower

Can't create ember record from console

I've just started learning ember.js (v2.0.0), I was following this page, and at one point, the tutorial instructs me to create 4 records from the chrome console. I do exactly as instructed, but nothing happens. No errors, warnings, nothing.
On the Ember Inspector, I'm doing this:
On the console, after clicking ">$E" as mentioned in the image, I'm entering this:
$E.store.createRecord('customer', { name: 'John Smith', location: 'Boston', isSubscribed: false }).save()
$E.store.createRecord('customer', { name: 'Jenny Reed', location: 'New York', isSubscribed: false }).save()
$E.store.createRecord('customer', { name: 'Bill Crawford', location: 'Philadelphia', isSubscribed: true, subscriptionDate: new Date(), subscriptionDuration: 12 }).save()
$E.store.createRecord('customer', { name: 'Cathy Smith', location: 'Boston', isSubscribed: true, subscriptionDate: new Date(), subscriptionDuration: 6 }).save()
This is the screenshot after that.
EDIT: The data tab shows "customer(0)", customer being the model, with no entries. Also, I thought I'll just log what's in $E, but, I can't. I'm not clear with how that works. And, I checked my firebase server too. Nothing there either. But that's ok I guess considering that EmberFire just synced my Ember-Data records to firebase, and the Ember-Data record was empty here.
If things went as expected, I should have had 4 records synced to my firebase server, but that's not what happened.
I have the Ember Inspector from Chrome Web Store installed.
Basically, I've followed the instructions exactly as described in the tutorial.
Hours of googling didn't help.
Any help is appreciated. Thanks.

How to refresh tab panel items in Sencha Touch 2

I am using a tab panel (Ext.tab.Panel) that has 4 tabs and on one of the child screens when the user make a selection from a radio button group, I would like the tab panel to refresh itself (i.e. load new text, new icons). How can I force the tab Panel (which is the core navigational element of the app) to refresh?
I have tried setting the show: function() { } method on the view as follows:
Ext.define('MyApp.view.Main', {
extend: 'Ext.tab.Panel',
...
show: function() {
this.callParent();
... reload stuff
}
});
The tabs/icons in a Ext.tab.Panel make up the items property of the component. To change these tabs/icons you must change the items.
Use setItems(items) to effectively change the tabs/icons of the Ext.tab.Panel inside your listener.
var tabpanel = Ext.getCmp('tabpanelid'); // Get appropriate panel using its id
// Removes the current tabs, and inserts the following 2 tabs
tabpanel.setItems([
{
title: 'Tab1',
iconCls: 'info',
html: 'Foo'
},
{
title: 'Tab2',
iconCls: 'reply',
html: 'Bar'
}
);
Check out a working example here.
UPDATE: To modify one of the current items, use getItems(), modify the appropriate items, and call setItems(items).
Updated Example

Stuck scrolling of a list, using Sencha Touch

What I am trying to do is have a "load more" button at the bottom of a ajax populated list. I have got all the code working with a docked button, but I would now like to have it at the bottom.
What is happening is when the listView card is show I see my list but the list won't scroll. It pulls up and down a little but just won't have it. I have tried adding different configurations and layouts to listView with no different.
What I have done is the following
var moreButton = new Ext.Button({
text: 'Load more...',
ui: 'round',
handler: function() {//Do the loading - this works}
});
//In my list config I have a docked top bar for going "back" other than that pretty standard
var list = new Ext.List(Ext.apply(listConfig, {
fullscreen: false
}));
//This is my view for what I am trying to do
var listView = new Ext.Container({
items:[list, moreButton]
});
listView is then added to an other container as it is populated from a search box, it is show with setCard when I get a valid response from the server.
[sencha person] are you on 0.98? I think we had a regression in our scroller. Might want to downgrade back to 0.97