How can I deselect all selected option of a dropdown when selecting an option in a different dropdown? - drop-down-menu

I am having two dropdown menus/ comboboxes on which I can select content which I wanna display on a DataTable.
The first Combobox is called ColorCombo and gets the following options to choose from an Excel sheet:
Sort(Distinct(Table3;Color);Result;Ascending).
The second Combobox is called SizeCombo and gets the following options to choose from an Excel sheet:
Sort(Distinct(Table3;Size);Result;Ascending).
My question is how can I make my code work so that each time I choose a color on one dropdown, then all options from the other dropdown are being deselected? I tried to reset the comboboxes when the onChange even triggered as follows:
ColorCombo onChange : Reset(SizeCombo)
SizeCombo onChange : Reset(ColorCombo)
But this doesn't work because every time I choose a new option then all options from the drop-downs are being unselected because the events trigger each other. Could someone help understand how I could go about it?

If you can only have a value in either one of the drop downs, you could make the onChange variable of each one set the DisplayMode of the other one to Disabled. eg:
ColorCombo onChange : SizeCombo DisplayMode.Disabled
SizeCombo onChange : ColorCombo DisplayMode.Disabled
Sorry if I misunderstood your question!

Related

Jqgrid - How to create a custom add-button that you can supply of parameters

When you create a jqgrid there is a default button on the bottom of the grid that allows you to create new records.
However, when you open the modal, all input fields are empty.
In my situation I need this button, but I also need the exact same thing but with the possibilty of adding a few parameters so some of the fields are already filled in. The parameters would come from the selected row at that moment.
Like when I click a row where the date is set to 01/01/2099 i need the add-modal to open with the date already set to that date.
You can use beforeShowForm or afterShowForm to make any changes in the Add Form during opening. For example you can read the values from currently selected row and fill some fields of the form with new values. To be open Add form on click or double-click on the row you need just call editGridRow inside of onSelectRow/ondblClickRow callback.

Multiselect option with remove item

I'm looking for a Qt/QML multiselect control that have a remove button.
I want to add a filter builder and I didn't find a good example or control for this purpose.
I can design token by myself. I'm just curious if someone already did that and can share it.
Multi filter selector
Thanks
A simple radio button for each option can do the job. If you do not include all these radio buttons under an exclusive group, a second click on these buttons deselects the option.
A click on the radio button includes selected option in the search results and second selection removes the option from the results.
An extra button which deselects all the radio buttons can also be added.
I don't intend to insult or disrespect you, but i think with radio buttons the task takes less time than posting this question.

Click an element in jqgrid and select the row it is in

When you click on a row in jqgrid it gets "selected" (applies some coloring and styles), other "selected" rows get deselected. However, when I click on an input button element in one of the cells in a row nothing happens... the row is not "selected". How would I make the clicking of this button (or link or whatever) cause the row to be "selected" (and deselected when a different row is clicked)?
Solution:
In the gridComplete method of jqgrid I can attach a click handler to each button, get the ID of the button's parent row and then call jqgrid's setSelection method on it, passing in the required row id as a parameter.
$('#mygrid').find('input[type=button]').each(function() {
$(this).click(function(){
var therowid = $(this).parents('tr:last').attr('id');
$('#mygrid').jqGrid('setSelection', therowid );
});
});
On "tricky" thing about this is that instruction on the jqgrid website show two different ways to go about doing this. The above uses the new API which does things rather differently so you will find a mix of suggestions online that switch between this new API and the older one.

in a jqgrid editform, i need to restrict checkbox selection to only one at a time

i have a jqgrid editform with three checkboxes. I need the checkboxes to function like typical html Radio buttons that let a user select ONLY ONE of a limited number of choices.
Unfortunately, jqgrid does not offer radio button editypes.
I know that i can setup an event to deselect all other checkboxes in the editform. Is this the only way to do it in jqgrid?
You can bind the click event to any from the checkboxes and in the event handler to uncheck all other chechboxes in the form if the current checkbox will be checked.

Flex 4 DropDownList Selected Item

the standard behaviour of a Flex dropdownlist is to disable the currently selected item from the list. Does anybody know how to override this to allow the user to re-select the selected item (if they so desire)?
NOTE: I don't want there to be a selected item in the list but I still want the selecteditem property to be set in the dropdownlist control, otherwise how will I know what has been selected. This is slighly trickier than it sounds...unless I have missed something...
Thanks
Mark
I'm not sure I understand the question but you can listen to close event of the component :
Dispatched when the drop-down list closes for any reason, such when the user: Selects an item in the drop-down list. Clicks outside of the drop-down list. Clicks the anchor button while the drop-down list is displayed.
So, you can access the component and gather the selectedIndex, selectedItem properties.
I guess what I'd like to know is that why you want to "re-select", possible to trigger something again but I'd try close event...

Resources