PageLoad載入:
protected void Page_Load(object sender, EventArgs e)
{
ManagersBind();
}
Binder 方法:
代碼
protected void ManagersBind()
{
//通過指令碼的方式清除原有的資料,清除選中的資料,使用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(a);
}
else
{
ComboBoxManager.AddItem(a.Text, a.Value);//coolite方法
}
}
}