Binding options dropdown filtering with textbox value in Google App Maker - dropdownbox

Good day to all,
I need your help to binding an dropdown in Google App Maker.
I have 2 datasources, one for value and other for options and names. The problem is when I try to filter the dropbox with a textbox value.
in TextBox's onValueChange I put this code but it does not work.
var item = widget.parent.descendants;
app.datasources.Prycts_Cmpns.query.clearFilters();
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.query.filters.s_AliasCompany._contains=widget.value;
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.load();
the next code is the datasources options,value and names of the dropdown:
How i can filter this dropdown with the filter?
Thxs

I have a feeling, that
User enters some filter in TextBox
In onValueChange you call clearFilters what wipes user's input
You load Prycts_Cmpns datasource with no filters
So to fix this you can check that the TextBox is bound to app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.query.filters.s_AliasCompany._contains and simplify onValueChnage event handler to this
// at this point filter's value should be already set by binding
app.models.FCTRSRCBDS.datasources.Prycts_Cmpns.load();

Related

how to clear the condition filter when main filter is empty in aggrid

I am using an ag-grid and i have enabled filtering, now i when type something in the filter textbox then the conditional filter is automatically shown.
My requirement is to clear the conditional filter text box when main filter textbox is cleared.
Below is the code i tried but i dont know how to check if the textbox is empty or not and how to clear the conditional textbox when the main textbox is cleared.
onFilterChanged: function(filterParams) {console.info('alert');},
You need to listen to events on your textbox and as soon as it is cleared, you call the grid api
gridOptions.api.setFilterModel(null);

Clearing semantic ui multiselect dropdown when values are selected dynamically?

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');

How to save Id for dijit.form.ComboBox

I'm writing my first dijit control for EPiServer. In my template I am using the dijit.form.ComboBox.
I have attached an event handler to the "onChange" event like so:
postCreate: function () {
// call base implementation
this.inherited(arguments);
// Init textarea and bind event
this.inputWidget.set("intermediateChanges", this.intermediateChanges);
this.inputWidget.set("store", this.store);
this.connect(this.inputWidget, "onChange", this._onInputWidgetChanged);
},
Then in my event handler I have:
_onInputWidgetChanged: function (e) {
alert(e.id);
this._updateValue(value);
},
My issue is that as with a typical dropdown list, I want to store the Value rather than the Text. The options in my combobox look like so:
Value | Text
1 | "Test"
2 | "A different test"
The problem is that the value passed into the _onInputWidgetChanged handler is always the text value of the combobox i.e. "Test" or "A different test"
How can I get access to the Value instead? As I said, this is the first time I have ever worked with dojo and dijit so I may be missing something fundamental here.
Thanks in advance
Al
The thing about ComboBox is that its value is not required to be an entry in the drop-down menu (and thus, not guaranteed to be one either). Think of it as a textbox with autosuggest - users can use the menu to expedite the process, but the value of the textbox is freeform and is reported as whatever the user types into it.
If you want users to be required to choose an entry from the menu, you should be using FilteringSelect instead, which will report the associated store item's ID (or associated option tag's value) as its value. As opposed to the free-form nature of ComboBox, FilteringSelect can be thought of as a menu with type-ahead functionality.

AutoCompleteBox (Silverlight 4) displays previously selected items in dropdown list

I intended to use a AutoCompleteBox (silverlight 4) in similar way like a save file dialog works: each time user types a string, only matching items are displayed in dropdown list.
However, this is not the behavior I get from AutoCompleteBox. I will describe the bahavior by example: in my case, I have collection with two strings: "xxx" and "yyy". The AutoCompleteBox is bound to that collection. User start typing "xxx". The dropdown list correctly displays "xxx". User selects "xxx" from the list. User deletes "xxx", and instead of it types "yyy". The dropdown list displays both "xxx" and "yyy".
What I tried to do:
1. Tried to play with FilterMode. If I using "None" mode, both items always being displayed. Any other mode provides the behavior described above.
2. Tried to set my own filtering predicate, by binding to Filter property on the model. In addition, set the FilterMode to "Custom". Any attempt to type inside AutoCompleteBox crashes the application.
I will really appreciate any help, burn on this already two hours..
Thanks
I've encountered the same error and for me it was caused by the styling of the ListBoxItem. Use the default styling and the problem should go away.
https://stackoverflow.com/a/5529940/2568763

dijit.form.Combobox show label Instead of value

I've a dijit.form.Combobox field which uses a ItemFileReadStore to pull Its data.
Teh ItemFileReadStore has two attribute per Item value which will be used for form submission , generally Unique Integers and label which is Human Understandable String.
In ComboBox HTML I've done searchAttr="value" labelAttr="label"
When the ComboBox Shows the list it uses teh label Attribute.
But When the User selects one of the Item it shows the value of that Item.
What I want is , The value Attribute will Still be used for Form Submission. But the User will always see the label in the combobox Control.
alt text http://img822.imageshack.us/img822/6660/dijitcombo.jpg
e.g. I Want to Show The Label for value 3 (Admin) instead of 3
Use FilteringSelect instead of Combobox.
Note: ComboBox only has a single value that matches what is displayed while FilteringSelect incorporates a hidden value that corresponds to the displayed value.
I have tried the following.
var cmbObject = Registry.byId('combo dojo id'); var id =
cmbObject.item.<Code Property>;
You should check if item is null.