Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

cascade dropdown not working



<div class="row" >
<div class="col-md-4">
<select aria-label="Select a Impact Level"
data-control="select2"
data-placeholder="Select an Impact Level..."
class="form-select form-select-solid form-select-lg fw-semibold select2-hidden-accessible" onchange="@CountryClicked">
<option value="">-- Select Country --</option>
@foreach (var country in ProcessImpactTypes)
{
<option value="@country.ProcessImpactTypeId">@country.ProcessImpactTypeName</option>
}
</select>
</div>
<div class="col-md-4">
<select aria-label="Select a Impact Level"
data-control="select2"
data-placeholder="Select an Impact Level..."
class="form-select form-select-solid form-select-lg fw-semibold " onchange="@CityClicked">
<option value="">-- Select City --</option>
@if (ImpactLevelMasters != null)
{
@foreach (var city in ImpactLevelMasters)
{
<option value="@city.ImpactLevelMasterId">@(city.Level + "|"+ city.LevelValue)</option>
}
}
</select>
</div>
</div>




protected async void CountryClicked(ChangeEventArgs countryEvent)
{
int value = Convert.ToUInt16(countryEvent.Value);
ImpactLevelMasters = await ProcessImpactBizServices.GetProcessImpactLevelByProcessImpactTypeId(value, ClientId);
EditImpactType.ProcessImpactTypeId = value;
StateHasChanged();
//cityList.Clear();
//cityName = string.Empty;

//countryId = countryEvent.Value.ToString();
//countryName = countryList.FirstOrDefault(s => s.CountryId == countryId).CountryName;


this.StateHasChanged();
}

void CityClicked(ChangeEventArgs cityEvent)
{
//cityName = cityEvent.Value.ToString();
this.StateHasChanged();
}


cascade dropdown is not working wth above code only first time value render to second dropdown then it does not work.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

Thank you for reaching out to us.

Your code looks fine and it should work. I guess in your GetProcessImpactLevelByProcessImpactTypeId you are fetching some data, please make sure that data is fetched correctly and ImpactLevelMasters is not empty.

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(