Sep 01, 2015, 8:16 AM
[CLOSED] How to restrict the Change listener event from firing in page load.
Hi,
In my requirement I have 4 multicombo box and a button. If any one of the multicombos is completely unselected, then the button shud be disabled.
Below is the code am using:
Currently I have applied the change listener to 'Multi combo 3', Since the change event fires during the page load, the multicombo 4 is undefined.
So I want to restrict the change event from firing at page load.
In my requirement I have 4 multicombo box and a button. If any one of the multicombos is completely unselected, then the button shud be disabled.
Below is the code am using:
<ext:MultiCombo ID="mltcmbWaterlineUnfunded" runat="server" LabelAlign="Left"
DisplayField="Name"
EmptyText="<%$ Resources:WebResource,WaterMark_Select%>" Resizable="false" Width="150">
<Items>
<ext:ListItem Text="Above" Value="1" />
<ext:ListItem Text="Below" Value="2" />
<ext:ListItem Text="Closed" Value="3" />
</Items>
<SelectedItems>
<ext:ListItem Text="Above" Value="1" />
</SelectedItems>
<Listeners>
<Change Fn="CheckForSelections" />
</Listeners>
</ext:MultiCombo>
var CheckForSelections = function () {
debugger;
var WaterlineFunded = #{mlcmbWaterlineFunded}; //Multi combo 1
var WaterlineUnfunded = #{mltcmbWaterlineUnfunded}; //Multi combo 2
var ProbabilityFunded = #{mltcmbProbabilityFunded}; //Multi combo 3
var ProbabilityUnfunded = #{mltcmbProbabilityUnfunded}; //Multi combo 4
if (WaterlineFunded.getSelectedValues().length == 0 ||
WaterlineUnfunded.getSelectedValues().length == 0 ||
ProbabilityFunded.getSelectedValues().length == 0 ||
ProbabilityUnfunded.getSelectedValues().length == 0)
{
#{btnFillRateView}.disable();
}
else
{
#{btnFillRateView}.enable();
}
//disable button
}
Currently I have applied the change listener to 'Multi combo 3', Since the change event fires during the page load, the multicombo 4 is undefined.
So I want to restrict the change event from firing at page load.
Last edited by Daniil; Sep 08, 2015 at 3:06 PM.
Reason: [CLOSED]