Coolite ComboBox control cannot be re-bound during Ajax request

Source: Internet
Author: User

PageLoad loading:

 

Protected void Page_Load (object sender, EventArgs e)
{
ManagersBind ();
}

 

 

Binding method:

 

Code

Protected void ManagersBind ()
{
// Clear the original data, clear the selected data, and generate a data script using AddItem.
Coolite. Ext. Web. ScriptManager scManager = Coolite. Ext. Web. ScriptManager. GetInstance (this. Page );
ScManager. AddScript (ComboBoxManager. ClientID + ". store. removeAll ();");
ScManager. AddScript (ComboBoxManager. ClientID + ". clearValue ();");

// ComboBoxManager. SetInitValue ("");
OrgChartDataObject. OrgChartDB. OrgChart_UsersDataTable udt = new OrgChartDataObject. OrgChartDB. OrgChart_UsersDataTable ();
Udt = users. GetAllUser ();
Foreach (OrgChartDataObject. OrgChartDB. OrgChart_UsersRow row in udt. Rows)
{
Coolite. Ext. Web. ListItem a = new Coolite. Ext. Web. ListItem (row. UserName. ToString (), row. UserId. ToString ());
If (! Ext. IsAjaxRequest)
{
ComboBoxManager. Items. Add ();
}
Else
{
ComboBoxManager. AddItem (a. Text, a. Value); // coolite Method
}
}
}

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.