Clearing semantic ui multiselect dropdown when values are selected dynamically? - dropdown

I am trying to load multiselect dropdown value based on click button action dynamically. When one click is performed value is selected and appended in the dropdown. But when I clicked next time, the dynamic values are appended to the previous value. So I decided to clear multiselect dropdown on each click.
But when values are selected dynamically, To clear dropdown
$('.ui.fluid.dropdown').dropdown('restore defaults');
$('.ui.fluid.dropdown').dropdown('clear');
Both also not working. Because of dynamic appending of data.
So my question is how to clear semantic mutiselect dropdown dynamically.

I tried to use the following code to clear the dropdown and it works fine.
var class_name = $('.ui.fluid.dropdown');
$(class_name).dropdown('clear');
$(class_name).dropdown('destroy');
$(class_name).dropdown('restore defaults');

Related

How to Update the Values of a Dropdown in a Subform when the Main Form Changes

I have two forms:
InterviewMaster and InterviewDetail
InterviewDetail opens up as a subform in InterviewMaster and these two forms are linked through a common field called InterviewID
In InterviewDetail I have a textbox called Questiontype as well as combobox called InterviewDropdown.
The data in the dropdown varies based on the data on in the textbox. To make this happen, I have a next button to move to the next question. Whenever I click on next the following runs:
Dim ctlCombo As Control
Set ctlCombo = Forms!InterviewDetail!cmbInterviewDropdown
ctlCombo.Requery
The Row Source setting for my combobox is set to look up the required answers, again this is based on the value as per the textbox:
SELECT [queryAnswerOptions].[Answer] FROM queryAnswerOptions ORDER BY [Answer];
So the options are determined by my query called queryAnswerOptions
So as I cycle through my questions using my next and previous buttons, the dropdown options are updated based on the value of my textbox. This works perfectly when I open the subform from the navigation pane. However, when I open the main form and click on the next button my dropdown does not have any values. I've tried requerying the subform with no luck. I've also tried opening the subform in full screen from my main form but this also does not work. I also don't want to go that route as it does not work well with the overall flow of my form.
Any assistance will be greatly appreciated.
Problem with the query WHERE criteria parameter is when form is installed as a subform, the form reference no longer works because it must use the subform container control name. I always name container control different from the object it holds, such as ctrDetails.
Option is to put SQL statement directly in combobox RowSource instead of basing combobox RowSource on a dynamic parameterized query object - then it will work whether form is standalone or a subform.
SELECT Answer FROM InterviewAnswers WHERE QuestionID = [txtQuestionID] ORDER BY Answer;

Devextreme Vue Datagrid configure selection and focus row together

I am configuruing my devextreme datagrid. I have to use both muliple selection and rowfocus together. I am able to limit selection on selection column checkbox only , so that I dont select a row if I click anywhere in the grid, It always have to be the selection checkbox. Now to include row focus it's creating a problem, when ever I am clicking selection checkbox it's focusing the row first, I have to click on it again to achieve row selection. So how do I prevent row focus event on selection checkbox column?
Refer below configuraion: -
<dx-data-grid :allow-column-reordering="true"
:allow-column-resizing="true"
:column-fixing="{enabled: true}"
:columns="config.columns"
:data-source="groupTypes"
:ref="ref"
:rowAlternationEnabled="true"
:show-borders="true"
#toolbar-preparing="onToolbarPreparing($event)"
key-expr="entityId"
:focused-row-enabled="true"
:focused-row-key.sync="focusedRowKey">
<dx-selection :select-all-mode="selectionMode"
mode="multiple"
show-check-boxes-mode="always"/>
</dx-data-grid>
I removed the :column-fixing="{enabled: true}" porperty from data grid, Now it's working

Setting Default Values to Drop Down in Orbeon Form Builder

I have a autocomplete field:
I need to set the default value selected for this dropdown using another control value as shown in:
This control is passed to the form load as shown in:
For example if use cost center is 110 as shown in:
Then the default selected value of the Site lookup dropdown needs to be as shown in:
The tricky part is that your Site-Item field isn't a dropdown but an autocomplete. An autocomplete doesn't know all the possible label/values, but can only find some label/values doing a search by label. So you can't tell an autocomplete "set your value to 110", because it doesn't know what the label corresponding to 110 is.
If you knew the label, you could do this programmatically with an fr-set-label, but here you don't have the label but the value. You can read more about this in the section Setting by value. So, my advice is to use a Dynamic Data Dropdown instead of an Autocomplete field.

Asp net mvc 4 Kendo dropdownlist

I have a kendo drop down list it binds on page load.
I have a filter section and I filter one drop down list and I click the submit button and its submitting the page.
When I am clicking the submit button I validates the drop down list whether the user selects the valid input or user types invalid data.
When I clicking the submit button, I save the valid data in hidden field and assigns the value to model property.
After submits the page the selected value(before submits) is selected in dropdownlist.
If now I submit the page once again the drop down list selected index comes as -1.
How to validate this drop down list in the above scenario?
You need to set it's value from model when rendering the page again.
You can easily set by following way using jquery:
$(document).ready(function(){
var dropdownlist = $("#movies").data("kendoDropDownList")
dropdownlist.value($("#value").val());
});

Dynamic / Static items in radComboBox. (SQL Query error)

I am using telerik's rad combo boxes (dropdowns) on my aspx page. there are 3 rad combo boxes and they are cascading dropdowns. the items in the final dropdown is dependent on the selection of the 2nd dropdown.
Now, i had to insert a "select all" option in the final dropdown. this being a static value, i added it using "appenddatabounditems" property of the rad combo box, setting it to be true. I can now see the select all option, but the items in the dropdown list are repeated. I have used the distinct keyword in the query. Also, when i make another selection in the 2nd dropdown box, the values in the third dropdown are appended i.e they show "Select all" + items of the previously selected 2nd dropdown option + values of the currently selected dropdown selection.
Am i missing something in the query? or there is something wrong with the telerik controls? or the ajax manager?
PLease help.
Thanks,
ghanshyam.
Are you using the EnableLoadOnDemand="true" setting to perform the cascade? The combo box does not clear the old items out automatically. Two things you can do:
Delete the old items OR
Bind the entire list to the combo box and hide the invalid ones. This has worked for us when the list is relatively small.
HTH.