This is a migrated thread and some comments may be shown as answers.

[Solved] Problem in Selecting Combo ClientSide

1 Answer 91 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brijendra Kumar
Top achievements
Rank 1
Brijendra Kumar asked on 15 Jul 2009, 12:40 PM
Dear Sir,


I have 4 combobox in a page and i am using update panel.
When i select "Home address", "office address", etc from 1st combo,
address details are not showing in other combos. whenever code is being executed.

 

function onCustomerAddress_Loaded(result) {

 

 

try {

 

 

var rows = result.rows[0];

 

 

if (rows != null) {

 

$get(

'<%=txtHCZipCode.ClientID %>').value = rows.ZIPCODE;

 

$get(

'<%=txtHCStreet.ClientID %>').value = rows.STREET;

 

$get(

'<%=txtHCZipCode.ClientID %>').disabled = true;

 

$get(

'<%=txtHCStreet.ClientID %>').disabled = true;

 

 

if ($find('<%=cmbHCCountry.ClientID %>').findItemByValue(rows.COUNTY) != null) {

 

 

//$find('<%=cmbHCCountry.ClientID %>').clearSelection();

 

$find(

'<%=cmbHCCountry.ClientID %>').updateClientState();

 

$find(

'<%=cmbHCCountry.ClientID %>').findItemByValue(rows.COUNTY).select();

 

 

//$find('<%=cmbHCCountry.ClientID %>').commitChanges();

 

$find(

'<%=cmbHCCountry.ClientID %>').disable();

 

}

 

else if ($find('<%=cmbHCCountry.ClientID %>').findItemByText("Select") != null) {

 

$find(

'<%=cmbHCCountry.ClientID %>').clearSelection();

 

$find(

'<%=cmbHCCountry.ClientID %>').findItemByText("Select").select();

 

}

 

if ($find('<%=cmbHCState.ClientID %>').findItemByValue(rows.STATE) != null) {

 

 

//$find('<%=cmbHCState.ClientID %>').clearSelection();

 

$find(

'<%=cmbHCState.ClientID %>').updateClientState()

 

$find(

'<%=cmbHCState.ClientID %>').findItemByValue(rows.STATE).select();

 

 

//$find('<%=cmbHCState.ClientID %>').commitChanges();

 

$find(

'<%=cmbHCState.ClientID %>').disable();

 

}

 

if ($find('<%=cmbHCCity.ClientID %>').findItemByValue(rows.CITY) != null) {

 

 

// $find('<%=cmbHCCity.ClientID %>').clearSelection();

 

$find(

'<%=cmbHCCity.ClientID %>').findItemByValue(rows.CITY).select();

 

 

//$find('<%=cmbHCCity.ClientID %>').commitChanges();

 

$find(

'<%=cmbHCCity.ClientID %>').disable();

 

}

 

if ($find('<%=cmbHCLocation.ClientID %>').findItemByValue(rows.location) != null) {

 

 

//$find('<%=cmbHCLocation.ClientID %>').clearSelection();

 

$find(

'<%=cmbHCLocation.ClientID %>').findItemByValue(rows.location).select();

 

 

//$find('<%=cmbHCLocation.ClientID %>').commitChanges();

 

$find(

'<%=cmbHCLocation.ClientID %>').disable();

 

 

}

 

if (rows.PHONE != null) {

 

$get(

'<%=txtHCPhoneNo.ClientID %>').value = rows.PHONE;

 

$get(

'<%=txtHCPhoneNo.ClientID %>').disabled = true;

 

}

}

 

// if ($get('dvLoading') != null) {

 

 

// $get('dvLoading').style.display = 'none';

 

 

// }

 

 

return false;

 

}

 

catch (e) {return false;

 

}

}



 

function

HMC_Country_SelectedIndexChanged(sender, args) {

 

 

try {

 

 

if (locationArray != null) {

 

 

var country;

 

 

var stateControl;

 

country = $find(

"<%= cmbHCCountry.ClientID%>").get_value();

 

stateControl = $find(

"<%= cmbHCState.ClientID%>");

 

stateControl.clearSelection();

 

if (stateControl != null) {

 

stateControl.get_items().clear();

stateControl.commitChanges();

comboItem =

new Telerik.Web.UI.RadComboBoxItem();

 

comboItem.set_text(

"Select");

 

comboItem.set_value(

"");

 

stateControl.get_items().add(comboItem);

 

for (var rowIndex = 0; rowIndex < locationArray.rows.length; rowIndex++) {

 

 

if (locationArray.rows[rowIndex].crm_sug_country == country) {

 

 

if (stateControl.findItemByValue(locationArray.rows[rowIndex].crm_sug_state_code) == null) {

 

comboItem =

new Telerik.Web.UI.RadComboBoxItem();

 

comboItem.set_text(locationArray.rows[rowIndex].crm_sug_state);

comboItem.set_value(locationArray.rows[rowIndex].crm_sug_state_code);

stateControl.get_items().add(comboItem);

}

}

}

stateControl.commitChanges();

 

if (stateControl.findItemByText("Select") != null) {

 

stateControl.findItemByText(

"Select").select();

 

}

}

}

 

return false;

 

}

 

catch (e) {return false;

 

}

}


Please help....


Thanks & Regards
Brijendra Pandey

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 15 Jul 2009, 02:02 PM
Hi Brijendra Kumar,

Please see this demo as a reference of the 'Related ComboBoxes' approach implementation.

Greetings,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
ComboBox
Asked by
Brijendra Kumar
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or