Kendo UI for Angular combobox, filtering with two letters occasionally returns empty results - combobox

I did notice some weird behavior when filtering inside a combobox.
Entering a single letter works wine and narrows results, but here is what happens if I type t, and then tr, tra. What could be causing that?
Using backspace from tra to tr displays correct result.
Did notice that behavior in some other comboboxes on current screen.
Yes this is using Kendo-UI for Angular Combobox.
<form-combobox [data]="pickListData.activityTypes"
valueField="code"
textField="codeDescription"
[loading]="pickListDataLoading$ | async"
[defaultSelected]="0"
[filterable]="true"
[ngrxFormControlState]="formState.controls.activityType"></form-combobox>

By using [filterable]="true" you are stating that the list should be filterable. But you actually have to write a function like (filterChange)="handleFilter($event)" where you filter the data from the list based on the typed input.
If you want the kendo combobox to take care of filtering then you can simply use [kendoDropDownFilter] to which you can provide settings like if you want the search to be case sensitive and others.
Ref- https://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/filtering/

Related

Grafana custom editor for every query/series

I was wondering if it is possible to write a custom editor (StandardEditorProps) that displays multiple input fields dynamically for every query (every series in the dataFrame).
I would need the same form (labels, bunch of select and text input fields) repeated for every query (I need to get the field names of the query resultset).
These values will be then used to render the custom panel plugin.
If I return, in StandardEditorProps, the entire form, then onChange every select input field is updated with the same value and I cant get the value of every input field in the custom panel plugin as only one customEditor is added in the module.tsx.
On the other hand, If I define multiple custom (and others non custom) editors in module.tsx I can get the values in the panel plugin but I cant make N such forms dynamically.
Hope that makes sense.
Does anyone have any suggestions or ideas how achieve that?

clearing a material-UI autocomplete field on the press of a button

I am using material-UI autocomplete for a project that involves rendering a dynamic array based on what you select from the menu. I am finished with the project and now trying to implement multi-select to make choosing things from the menu easier. When you have everything you want from the menu, you click an "Add" button that takes everything you currently have selected and adds it to a table (and adds the properly formatted text into a query on the side, the goal is to build queries for users without them worrying about syntax). When I was not using multiselect, and only adding one thing at a time to the query, I was easily able to clear the autocomplete field by changing the value prop to null. This prevents users from adding the same fields to the query over and over (when add is clicked the options that were added are popped from the list of options). When using multi the rules seem to change and now changing value directly causes an error. My question is, does anyone know of a way to programattically click the x button built in to material-ui autocomplete fields to clear that text field in an event handler? Or is there any reliable way of clearing that on my end?

Setting filters in ui-grid doesn't work

I am trying to set the filter in ui-grid pragmatically but doesn't seem to work with ranges.
This plunkr shows one of the filters working perfectly (the name). But the age filter populates the input box but doesn't appear to update the grid's filter.
Do I have to manually update the filter?
I have also tried setting the entire filter when the button is clicked by:
$scope.ageColumn.filters=$scope.ageFilter;
but that also doesn't work.
Any idea how to get this to work?
Looks like we need the term to be a string - when it's a number it doesn't work.
$scope.ageColumn.filters[0].term='30';
http://plnkr.co/edit/2TvIqdKYeRuYXUx1bRNo?p=preview
Not sure why that would be the case, so I need to take a look at that.

ExtJS 4 - How to persist values of textfields in a floating panel when panel is hidden/shown?

I am building an ExtJS4 Web Application and there's a part where the user is shown a "Search Panel". It's basically a floating panel with textfields and a gridView. The textfields allow the user to put his or her input for first name and last name filters. There's also a combo box that the user can use to filter the search. The results are shown in the gridView. The search functionality works well.
However, when the floating panel is hidden and then shown, the fields are reset and the user would have to enter the input once more.
What I want to happen is for the textfield and combobox values to persist even though the panel is hidden then shown again. I have tried using setVisibility(false) then using setVisibility(true) but that did not work for me.
How can I persist values of fields when their parent view is hidden/shown?
The fields should have retained the value as you are just hiding and showing the search panel. It seems there is a bug in your program, but I cannot ascertain that without seeing some code. Assuming that your search panel includes a close button, I would suggest you to use closeAction: 'hide' on the panel instead of using setVisibility(). Also make sure that you are not creating multiple instances of search panel, use a single object of search panel.
Here is a quick fiddle http://jsfiddle.net/DirtyParadoxx/gL9aekzz/
If you want to use cookies, then as Nikolay Lopin suggested, stateful: true would be a nice way of doing it.

ComboBox selection not reset to top of dropdown list (items) in javafx 2.2

I have a Source ComboBox to populate source fields (25-30 items) shown below in first page
"A"
"B"
...
"Z"
I have selected last item from ComboBox as shown below
"Z"
and when traversing to the next page after saving, i need to make the source combo selection blank, so i have return the below code to reset the Source combobox to point to first item (to reset the display to start from top of dropdown list for user selection)
// my first value in source List is empty space - “”
sourceComboBox.setValue("");
even if you use below code snippets like
sourceComboBox.getSelectionModel().selectFirst();
sourceComboBox.getItems().clear();
sourceComboBox.getSelectionModel().clearAndSelect(0);
but when i click open the combobox dropdown it still shows dropdown display from bottom as shown below
...
"X"
"Y"
"Z"
I am unable to post images for representing combobox values, so has put in above examples.
This looks like a graphics bug to me or am I doing something wrong?
I have seen similar issue reported in below question but no work around suggested so far
Combobox clearing value issue
If you want to simply "reset" the combo box, I think all you have to do is set the value to null, like so:
sourceComboBox.setValue(null);
I ran into nearly the exact same situation and came across your question while looking for a solution. Fortunately, I came up with a workaround that forces the ComboBoxes to reset. When you reset the data on your pane, instead of doing something like:
sourceComboBox.getSelectionModel().clearSelection();
sourceComboBox.getItems.clear();
do something like this...
parentNode.getChildren().remove(sourceComboBox);
sourceComboBox= new ComboBox(); // do whatever else you need to format your ComboBox
parentNode.add(sourceComboBox);
You'll also need to do a setItems() again on your ComboBox so the new one will be populated. This is not an ideal solution but it seems to be working as I expect the provided clearSelection() method would.
Below is the code you're looking for. It will reset it to whatever index you give in within the parenthesis.
sourceComboBox.setSelectedIndex(0);
Goodluck
Most of the things were giving me an error when I tried them. What worked best for me was to use this
comboBox.getSelectionModel.clearSelection();
This will essentially set the value of your ComboBox to null. Because of this, if you are referring to the value of the ComboBox in another place, it becomes important to check for whether the value of the ComboBox is null using this
if(comboBox.getValue() != null)
//Code segment here
The ComboBox control has not a method like scrollTo(index) of the ListView. So it seems hard to workaround that behavior. You can issue a feature request at JavaFX Jira.

Resources