I have an issue with one of my ExtJS items. I have a list of items most of which are buttons with icons, but one is an href with a bit of html. I want to hide these items whenever an external property is disabled.
To do that, inside of the items I have been using the following
hidden: !this.external.prop.enabled
For the buttons this works fine. They are visible when the prop is enabled and totally hidden when the prop is disabled. The item that uses html however, is hidden every time. Even when I set hidden to false like so
hidden:false
the Item looks like this
{
xtype: 'box',
margin:'5',
autoEl:{
tag: 'a',
hidden: !this.external.prop.enabled,
href: BaseURL + Glue.uiConfig.url.launchProp,
html: 'Launch Prop'
}
},
These items are all in the same array so I'm not sure why they are exhibiting different behavior. Has anyone ever experienced something like this? Do I need to provide more information?
thanks,
Put the hidden outside the autoEl config.
Related
I am working with accessible the website using keyboard and while tab press, Dynamic div(with ngIf)conditions is not working as expected.
I do have dynamic element with conditions to display one or other, when i focus on particular div element and click on button to go different element my focus is getting lost.
I have tried with providing the tab index with orders but not found any luck.
<!-- begin snippet: js hide: false console: true babel: false -->
The main issue the template which is being applied dynamically. You are trying to access the element which is not yet generated by angular.
In other words we cannot access the element which is not yet generated.
So I have removed the ng-template and applied the [hidden] attribute.
Working copy is available here - https://stackblitz.com/edit/angular-s8gvp9
How to make a DOM div reappear with new parameters applied to it, like different color, different number of children elements; after ng-show =false hiding it from the page?
ng-show = true is one part, but how can i modify it before it reappears or while it is reappearing? Basically, that div contains
<div> ng-show="showdiv" ; ng-repeat="x in elements" </div>
and iam trying to make it reappear with a different set of elems from elements
Set a variable in your controller where you store a boolean value. Set the ng-show to that variable. Now if you set this variable to true, the element reappears.
JS:
$scope.showDiv = false;
HTML:
<div ng-show="showDiv"></div>
You can add specific class to div which will change appearance of div:
HTML:
<div id="test">sample</div>
JS:
$('#test').addClass(class);
you can also use toggleClass if you want revert it after another change.
It's not a angular but it's jquery. Your question isn't quite explained. Describe more details (html/js) for further help.
Hope this will help you.
How can I go about creating a form which pops up when the user clicks a button on a Jade template? I tried the following in HTML, which works:
http://www.formget.com/how-to-create-pop-up-contact-form-using-javascript/
Now to use this in my Node.js project would I need to create a separate Jade file for the form itself? That is what I tried and then I tried to display the form like this:
function div_show() {
alert("Test");
document.getElementById('abc').style.display = "block";
}
Unfortunately that does not work. What is the recommended approach for creating a pop up form in Jade? I am really confused with Jade and I can't seem to find a good tutorial for this, there are loads for HTML...
Thanks for the help!
Normally for this you would use:document.getElementById('abc').style.visibility="visible";
To hide your table use:document.getElementById('abc').style.visibility="hidden";
When using the 'style' attribute you are using plain css commands. Make sure your default div style settings have it 'hidden', if that is what you want.This display:block;visibility:hidden;' must exist in your default settings for that div style so the DOM has a clear path to what it is controlling. By itself 'display:block;' does not hide or make objects visible, it is mostly about the shape the div creates as a container for objects.
As an option you can use:
document.getElementById('abc').style.display="block";
To hide your table use:document.getElementById('abc').style.display="none";
For this you would set your div style settings to 'display:none;visibility:visible;.
In this case 'display="none"' removes the object from all display layers and could allow other objects to fill in it's space. When it is visible it will push other objects on the same z-index out of the way. If it has a higher z-index, say +100 higher, it will pop-up above the other objects on the page. The 'visibility' attribute only controls the objects visibility, it does not remove it from the display memory. It can still take up space even though it is not visible. The 'opacity' attribute does about the same thing, except it allows you to also make an object as transparent as you like.
I think I'll just start of
Explanation:
I'm currently building a Site written in jQuery and I'm using multiple techniques wich allows the site to construct itself like Ajax Object returning functions inside a normal class not singleton, but i also have singleton based classes in other areas of the page which are loaded asynchronously via Ajax and so on...
At the beginning i call a self made function that is a chain of functions which each are attached to other functions, classes and variables declared within and out of my singleton Page-Class Construct (But all still on the same Document|Window).
"Page is the actual name of the class".. So on
$(window).load();
i call
Page.SetupPage();
Loading some Cookies with md5 encrypted data (WORKS)
Loading The Site Menu Bar via Ajax which contains : "the Site Menu
which is getting its data from a DB", "the Search Panel(jQuery
autocomplete) drop down menu", "the user panel and the shopping cart HTML Drop Down Menus" <-- (THE
PROBLEM IS HERE), then turning it in to a smart menu Element with the
jQuery smart menus Plugin.
Loading The Pages Body in a Div Container which properties are set within
the first step (WORKS)
THE PROBLEM:
If I'm trying to access a existing Div inside the MegaMenu HtmlDropDown Div inside the Smartmenu formated element, i am not able to build further elements in to that dropdown menu because I'm calling the userPanel at the beginning of the page, wich also had the same problem with my auto user recognition unless i call the API with 'itemActivate' a#mydiv, the plugin sets any other open mega menus CSS display properties to none
SO:
I'm currently also including a second js script that has a singleton class named ShoppingCart which has a function named ShoppingCart()... If i call that on $(window).load() i get the json response object and can fill it into an array... but unless I'm not setting the css property of the shoppingCart DropDown UL Tag to "display" -> "block" i can't access the div inside that smartmenu html dropdown megamenu and append items to that div and further more: i cannot call the jScrollPane plugin at the end of the append inside the mega menu HTML drop down div wich i'm trying to access, because i use an other focus on a other menu button to make sure everything is loaded as it shoul!
THE FUNNY THING:
$('#main-menu').smartmenus('itemActivate', $('a#shoppingPanel'));
$('#ShoppingCartDiv').css({ 'min-width' : 300, 'height' : 200 }).attr({ 'class' : 'scroll-pane' });
$('#ShoppingCartDiv .jspContainer').css({ 'min-width' : 300, 'height' : 200 });
$('#ShoppingCartDiv .jspPane').css({ 'min-width' : 300, 'height' : cartItems.length*64 });
$('.scroll-pane').jScrollPane();
$('#main-menu').smartmenus('enable', $('a#shoppingPanel'));
if I'm adding these lines inside the each append function of my "setShopingCartItems" function and afterwards calling the jScrollPane function, it works... but when i'm changing to another area which contains a scroll pane element, it breaks the scroll pane in the cart area...
Do you have any suggestions how to append and style elements without the display of the parent is set to block? Or how do i achieve that goal best and in a more cleaner way?
All Answers are appreciated! Thanks in advance!
*EDIT*
Ok i've made it using the display and Opacity properties setting display to block and opacity to 0... after i made my changes i revert those to with display to none and opacity to 1...
Ok i've made it using the display and Opacity properties setting display to block and opacity to 0... after i made my changes i revert those to with display to none and opacity to 1... For whatever reason! CLOSED
I'd like to conditionally hide a tab in a TabNavigator. It seems that setting visible doesn't work properly (presumably because this is how the TabNavigator hides the tabs that aren't currently selected).
What's the right way to do this?
You can do this by making use of TabNavigator's getTabAt() method which returns the Button that makes up the visual tab. You can then set that Button's visible property. It's a little tricky to get this setup with a bindings, but it's doable.
You could also consider just disabling the tab instead, which you can do by setting enabled on the corresponding TabNavigator child (for which visible didn't work).
What do you mean by hide? If you actually mean remove, then just take your array that's bound to the data in the TabNavigator, and remove the applicable element from it.
If you want to just have them removed temporarily, create a component of your own that encapsulates the TabNavigator and has an array of removed tabs and an array of actual tabs. Then handle this as you see fit.
You might want to check out the flexlib project. They have a component called SuperTabNavigator that adds a lot of functionality to the base Flex TabNavigator, including hiding tabs (I think).
If you do have to create your own component, though, it's a bit more tricky. The thing to know is that "tabs" are actually specially styled buttons, contained within a TabBar component (the TabBar is then contained within the TabNavigator). What you'll have to do then, is subclass TabNavigator and have some property on your views (i.e. the canvases, etc. that are added to the TabNavigator) that is bound to the visible and includeInLayout properties of the TabBar buttons.
In essence, what you'll have is something like:
BindingUtils.bindProperty( tabButton, "visible", view, "someProperty" );
BindingUtils.bindProperty( tabButton, "includeInLayout", view, "someProperty" );
I don't know about TabNavigator, but in other containers, you can set the includeInLayout property to false and it will be ignored. You probably still need to combine it with visible.
var secondTab = tabNavigator.removeChildAt(0);