PDA

View Full Version : [CLOSED] multicombo clearValue not unchecking items



cynsystems
Jul 12, 2014, 6:51 PM
I have a multicombo box and need to clear the selected values.
all these methods clear the selected values but does not uncheck them in the dropdown list


Html.X().MultiCombo().ID("cmbBStream1").Width(90).Items( new ListItem("All", 0),new ListItem("One", 1), new ListItem("Two", 2), new ListItem("Three", 3))
.Plugins(Html.X().ClearButton().Listeners(l => l.Clear.Handler = @"this.clearValue();"))
,
Html.X().MultiCombo().ID("cmbBStream2").Width(90).Items( new ListItem("All", 0),new ListItem("One", 1), new ListItem("Two", 2), new ListItem("Three", 3))
.Plugins(Html.X().ClearButton().Listeners(l => l.Clear.Handler = @"this.reset();"))
,
Html.X().MultiCombo().ID("cmbBStream3").Width(90).Items( new ListItem("All", 0),new ListItem("One", 1), new ListItem("Two", 2), new ListItem("Three", 3))
.Plugins(Html.X().ClearButton())

Reading the release notes I believe this is fixed
************************************************** ************************
* Version 2.3.0 CHANGELOG *
************************************************** ************************
Release Date : 2013-10-11
Current Version : 2.3.0
Previous Version : 2.2.0
[r5360] clearValue method doesn't reset checkboxed in MultiCombo picker

but my version is Product version 2.4.0.29010 12/10/2013

so...what am I doing wrong? Thanks! Cyndi Pruett

Daniil
Jul 14, 2014, 2:06 PM
Hi @cynsystems,

A JavaScript error occurs there. You should see that error in a browser.

An error occurs, because "this" doesn't have the clearValue and reset methods.

The "this" reference is a Button instance, not a MultiCombo one.

Please use:

this.field.clearValue();

This should also work:

this.field.reset();

It is up to you to decide you need a clearValue call or a reset one.

cynsystems
Jul 14, 2014, 5:24 PM
Thanks!
That did the trick...just another example of "how to hold your mouth"
Cyndi