Dependent <material-dropdown-select> - dart

I want to link multiple <material-dropdown-select>, using [(ngModel)] + (ngModelChange), making them dependent. (So not by using *ngFor + <material-select-item>.)
But I do not find how to make these <material-dropdown-select> dependent, such that when the "parent" is updated, the "first child" is updated/reset, and then when the first child is selected, the second is reset/updated, and so on.
I tried with querySelector() but obviously, this is not the good way.
Maybe with ViewChild/ViewChildren but the options list is not updated???

Well I finally get what I needed.
I used #ViewChild to target the element in the page.
But changing the options "was tricky", as I had to first :
MaterialDropdownSelectComponent.options.dispose();
then
add the new list…
without the first step, the SelectionOptions<dynamic> is not updated…

Related

Order of tabs on home page

Is there a way (or plugin) to order tabs on Jenkins home page? By default, they are sorted in alphabetical order.
Only info I've found is 'no', but it is quite old.
I was looking for a plugin that lets me sort tabs manually a couple of weeks ago. I didn't find anything. So I'm almost sure the answer is still no.
As a workaround we use a prefix like "(0) Viewname A", "(1) Viewname B" etc. in order to have the most important views accessible by one click.
You can add a script to Jenkins, this way it will load each time the view is up.
Go to:
Manage Jenkins->Configure System-> URL of theme JS and add the script.
I used the following script:
sessionStorage["ts_direction::" + window.location.toString() +"::0"] = "type=string&value=3%3Aup"
This order the columns by the 4th column (remember this will affect all of the views!).
example:
You can try Nested View Plugin (a functional plugin based on the hudson.model.TreeView class) which allows grouping job views into multiple levels instead of one big list of tabs.
Alternatively prefix the names with numbers (e.g. 1-Foo, 2-Bar, 3-Baz, etc.).
Prefix the view name with a soft hyphen ­ to make them appear at the end or with a space to make them appear infront ­
shy = String.fromCharCode(173);
chars = ['A','B','Z', shy + 'Z','a',' a','b','z',];
document.body.innerHTML = chars.toString() + '<br/>' + chars.sort().toString()
<html><head></head><body></body></html>

Directly modify a specific item in a TKinter listbox?

This is one of those just-making-sure-I-didn't-miss-anything posts.
I have a TKinter GUI in Python 2.7.3 that includes a listbox, and there are circumstances where I'd like to directly modify the text of a specific item at a known index. I've scoured the documents and there's no lb.itemset() method or anything like it. As best I can tell I have two options, either of which would work but just seem kind of klunky to me:
lb.delete() the old item and lb.insert() the new value for it at the same index (including a step to re-select the new value if the old deleted one happened to be selected).
Create a listvariable for the listbox, then use get() and set() on it -- with a pile of replace/split/join acrobatics in between to handle the differing string formats involved.
Is there some simpler, more direct way to do it that I'm missing? Or have I turned up all the available options?
Assuming from silence that there's nothing I missed. I went with option 2 -- the acrobatics weren't quite as complex as I'd thought. I just created a behind-the-scenes list wrapped up in a class; every time I update the list, the class syncs up the content of the listbox by doing a ' '.join on the list then setting the listbox's listvariable to the resulting string.

Tree List Ex Editor - change adding of selected item to the top of the list instead of bottom

One of our clients has a website that uses a lot of TreeListEx type field. By default, when an item is selected and moved over to the right side in the TreeListEx editor, the selected element is added to the bottom of the list on the right. The editors for this client would like to have this changed so that the element is added to the top of the list on the right.
For this I tried to look in the Shell folder at Treeview.js and Treelistexeditor.js. But I could not figure where to make the change.
In the TreeListExEditor.js file, look at the scSetMastersType.prototype.moveRight() function. In a loop it calls selected.appendChild(opt) which you may want to change to prepend the option. This would require a bit of JavaScript hackery on your part.
Perhaps start with a typeof(selected) to see what it is. I assume an array. If so, maybe do this:
Reverse the original array
Append your new item at the end of the revered data
Reverse it again to back to normal. Now your new option is at the beginning
Again, because this is JavaScript, there are plenty approaches you can take.

Dynamic embeddedForm

I'm looking to add an embeddedForm dynamically in Symfony 1.4 using Doctrine.
What I'm mainly looking to do is:
1) Only show the relation based on whether or not a checkbox has been ticked
2) If checked, show the embeddedForm
3) Have then the ability to add a new embeddedForm or delete an existing form
I have seen ahDoctrineEasyEmbeddedRelationsPlugin, which looks pretty good with los of configuration. The only problem was that 'newFormsInitialCount'=> 1, means that there is always 1 form as default. I need 0 forms as default and only.
I've also seen a couple of tutorials, but all seem to have at least one relation by default.
For me, the embeddedForm needs to be OPTIONAL, and only display when needed.
Thanks
Follow information based on these links :
http://www.thatsquality.com/articles/stretching-sfform-with-dynamic-elements-ajax-a-love-story
http://www.symfony-project.org/more-with-symfony/1_4/en/06-Advanced-Forms#chapter_06_sub_the_form_saving_process
First is about adding "subforms" with ajax, derived from second you could hide the unneeded form fields and toggle them per javascript (e.g. jQuery.toggle())) !

auto_complete_for: prevent the first item from being auto-selected

The auto_complete_for dealio from script.aculo.us is great an all, but is there a way for me to selectively disable the fact that it always auto-selects the first item in the list?
The problem is that, if I want to type my own entry that is new, and novel, I don't want the first item in the list to be auto-selected. The reason is because when I TAB out of the field, it selects, and fills the text box with that first item.
I got around that, somewhat, by making the first item in the list the same as what I'm typing, but that's not perfect either, because the auto_complete list doesn't always update with every keystroke, depending on how fast I type. I've tried setting the list refresh rate to the lowest value (1 millisecond) but no go.
What I really want is an option in "auto_complete_for" that doesn't select that first item at all - the same way that Google Instant doesn't automatically select the first suggested search phrase - you have to arrow-down to select one.
Maybe I can do this via an HTML option that I'm missing?
Looking at the source, there doesn't appear to be an option for that, but I bet if you changed line 284 of controls.js to this.index = -1; it would do what you want.
Otherwise, it might be time to look for a different autocomplete widget.
If your requirements are too far away from the available plugin, then I guess there is no point in tinkering around. Its best to write your own JS code.
You might want to consider this: https://github.com/laktek/jQuery-Smart-Auto-Complete
or this : https://github.com/reinh/jquery-autocomplete
I'll add another alternative that works great with Rails 3:
http://github.com/crowdint/rails3-jquery-autocomplete
I recently implemented auto complete for more than a field for Rails 2.0.2.
The plugin I used is:- https://github.com/david-kerins/auto_complete . Not sure if it supports Rails 3.
I have also encountered issues on implementing the above scenario and have posted questions( Implementing auto complete for more than one field in Rails ; Implementing a OnClick kind of functionality and formatting wrt Rails Partial-Views ) on stackoverflow for the same, I have been lucky on getting things working for me based on my requirement.
Kindly refer to these questions, they might have relevance to your requirement.

Resources