标签:blog io 数据 for ar cti div log
1.错的例子
sexCombo.on("afterrender", function() {
sexCombo.setValue(sexStore.getAt(0).data.code);}); /// <summary>
/// 查看范围的下拉框列表
/// </summary>
/// <returns></returns>
public JsonResult GetScanScopeList()
{
List<ScanScope> scopeLst = new List<ScanScope> { new ScanScope { Id = 0, scanScope = "未完成" }, new ScanScope { Id = 1, scanScope = "已完成" }, new ScanScope { Id = 2, scanScope = "全部" } };
return Json(scopeLst, JsonRequestBehavior.AllowGet);
}
/// <summary>
/// 查看范围的下拉框数据集实体
/// </summary>
public class ScanScope
{
public int Id;
public string scanScope;
}
这样的话,如果不首先手动的利用combo下拉选择一个的话,监听到的combo.getValue()就是""或者RawValue,我的是“”和“未完成”。
2.正确的做法:
var displayField = thisobj.down(‘displayfield‘);
var combo = thisobj.down(‘combobox[name=selectScanScope]‘);
var scanStore = combo.getStore();
scanStore.on(‘load‘, function () {
combo.setValue(this.getAt(0).get(‘Id‘));
});
至于这些语句,因为我的combo在tbar上,所以我写在了tbar的beforerender事件中。
Extjs Combo赋默认值,布布扣,bubuko.com
标签:blog io 数据 for ar cti div log
原文地址:http://www.cnblogs.com/denghuachengle/p/3920525.html