Order of selected element in jquery-select2 4.x - jquery-select2

I would like to use the 4.x version of jquery-select2.
I do not understand this behavior : having a multiple select, when I select elements in a specific order, they always are added in the same order they are in the base .
Is there any option to keep my selection order ?
In the previous version (3.x), the selected elements were always set in the same order they have been selected.
I did not try anything, only browse the documentation. But I did not found a case or an example, working like I want.

Related

how to select multiple checkbox in automation anywhere

I am running a loop where if condition met to select check box. I am unable to to do select multiple check boxes. It select first check box then run loop again but doesn't select next check boxes where condition are met.
enter image description here
To give some insight into what you're probably experiencing - Automation Anywhere object cloning basically operates like Javascript's getElementById in that it locks onto the first available item that meets the criteria you set forth in the object cloning parameters. There is no way to populate an array with these items like Javascript's getElementsByClassName might do.
This is interesting because if there are multiple items on the page that you're trying to work with and object cloning, by default, sets parameters that those items share, you'll only ever be able to interact with the first one.
I would suggest looking into additional parameters that distinguish each check box using Chrome's inspector or the other properties object cloning makes available to select.

How to display Groups alphabetically on swagger-ui?

I'm using Swashbuckle.AspNetCore to create my swagger-ui.
I can order operations within a group the way I want, but how to order the groups themselves?
Ex: the correct order would be: ContratedDemand, Demand, Subscriptions and Users, but I'm getting as the image below.
I'm using Swashbuckle.AspNetCore 1.2.0
UPDATE: According to #HelderSepu (tks!), I have to set the Tags and the operations will be ordered according to them.
So, how to set the tags the way I want using Swashbuckle?
I finally found the problem.
The issue was due a conflict with the "LowerCaseDocumentFilter" (an IDocumentFilter) used to create all paths with lower case instead of the default .net PascalCase.
The code I was using was found here: https://github.com/domaindrivendev/Swashbuckle/issues/834
That class works fine for its purposes, but as it adds and removes the paths from the SwaggerDocument path dictionary, it changes the groups order as a side effect.
I removed this filter and the groups are now ordered alphabetically.

SmartGWT: Checkbox Tree - the proper way to get selected checkbox value

SmartGWT has this property for a TreeGrid object:
employeeTreeGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
This by default 'prepends' every nodes (including root) with checkbox.
(Just making myself clear.)
Also, I am aware of this similar solved question:
GWT tree with checkbox:How to get all checked tree items?
However, I do not seek this kind of solution..
What I'm looking for is a more efficient way, where I don't have to loop through 1000 items.
Is there any way to do this, if possible, using the widget I am using now?
If not, is there any other way, using other widget?
Thank you very much!
I think as you use SelectionAppearance.CHECKBOX you tell to the grid that the selected records are marked by the checkbox field value. So every time you check one you select a record.
You can get the set of selected records by either getSelection() method or getSelectedRecords(boolean) because of deprecation of the previuous one.
You can have a look at the code of this example of the smartgwt showcase.

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.

set $value in sfWidgetFormSelectDoubleList

Actually I am using the sfFormExtraPlugin in symfony 1.4.4
I am using the class widget sfWidgetFormSelectDoubleList, all seems fine but when I open the form again in edit mode, There is nothing in associated select box.
So, My question is How to fill associated values in that box using sfWidgetFormSelectDoubleList widget?
I checked the database & values are present there.
$yourWidget->setDefault($values);
Values is an array with the values selected.
Good luck!!

Resources