首页 新闻 搜索 专区 学院

ext:label赋值和取值的问题

0
悬赏园豆:10 [已关闭问题] 关闭于 2012-11-19 23:02

我在页面上选择类型后修改页面ext:label的text值,然后我在后台再取该text,下面红色部分显示出来的值还是原来的值,有知道的告诉下 ,谢谢!

 

先赋值:

List<Ext.Net.Label> listLab = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.Label>(this.Page);
            List<Ext.Net.NumberField> listNum = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.NumberField>(this.Page);

            for (var i = 0; i < dt.Rows.Count; i++)
            {
                var labid = "rate" + i.ToString() + "_lab";
                var numid = "money" + i.ToString() + "_lab";
                listLab.Find(p => p.ID == labid).Text = dt.Rows[i][rate].ToString();
                listNum.Find(p => p.ID == numid).TabTip = dt.Rows[i]["b_id"].ToString();
            }

 

再取值:

 List<Ext.Net.NumberField> listNum = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.NumberField>(this.Page);
        List<Ext.Net.Label> listLab = Ext.Net.Utilities.ControlUtils.FindControls<Ext.Net.Label>(this.Page);
        List<string> valList = new List<string>();
        List<string> noList = new List<string>();
        var i = 0;

        foreach (Ext.Net.NumberField field in listNum)
        {
            string v = field.Text.Trim();
            if (!string.IsNullOrEmpty(v))
            {
                if (isCheckMinValue(v))
                    valList.Add(listLab[i].TabTip + "," + listLab[i].Text.Trim() + "," + v + "," + field.TabTip);
                else
                    noList.Add(listLab[i].TabTip + "," + listLab[i].Text.Trim() + "," + v + field.TabTip);
            }
            i++;
        }

ext
soarfe的主页 soarfe | 初学一级 | 园豆:146
提问于:2012-11-19 16:55
< >
分享
所有回答(1)
0

ext:label 如果用火狐查看到的不是HTML控件 而是span 标记 所以不能设置或获取到值的

loveandangle | 园豆:204 (菜鸟二级) | 2013-12-04 13:40

 具体设置: Ext.Net.X.GetCmp("employeeCode").Html = "用户编号: <font class='info_Lable'>  I0121140 </font>";

支持(0) 反对(0) loveandangle | 园豆:204 (菜鸟二级) | 2013-12-04 13:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册