Ext.Net 1.x_Ext.Net_JS获取页面EXT.NET控件

Ext.Net 1.x_Ext.Net.方法一:
      1. 一般控件: #{ControlID}.getValue();
          #{ControlID}.getText();
      2.TreePanel获取选择的节点: #{TreePanelID}.getSelectionModel().getSelectedNode()
              <Listeners>
                   <Click Handler="#{txtNewItem}.setValue('');">
              </Listeners>
方法二:
               <Listeners>
                    <Click Fn="Reset" />
                </Listeners>

API:
getCmppublic function getCmp(String id)
Ext.ComponentMgr.get方法的缩写。
参数:
id : String
返回:
Ext.Component
这个方法由 Ext 对象定义。

        var Reset = function () {

            Ext.getCmp("txtNewItem").setValue('');
        }

发布了921 篇原创文章 · 获赞 374 · 访问量 324万+
展开阅读全文

Ext.Net1.7 后台操作页面超时 并 实现进度条的问题

10-01

![](https://img-ask.csdn.net/upload/201510/01/1443698718_356785.png) 需要达到如图样式 protected void Page_Load(object sender, EventArgs e) { } private static string TableName; //要修改的表名 [DirectMethod(Timeout = 900000)] protected void btnOK_DirectClick(object sender, Ext.Net.DirectEventArgs e) { UpHouse(); } [DirectMethod(Timeout=900000)] public void UpHouse() { try { TableName = this.txtTable.Text.Trim(); DataTable dt = GetDataReader("select distinct HouseCode from " + TableName + " order by HouseCode"); //获取非重复的数据 foreach (DataRow dr in dt.Rows) { string HouseCode = dr["HouseCode"].ToString(); string strSql = "select Id,HouseCode,HouseNo from " + TableName + " where HouseCode = '" + HouseCode + "' order by HouseCode"; DataTable dtr = GetDataReader(strSql); for (int i = 0; i < dtr.Rows.Count; i++) { string HouseCode_new = dtr.Rows[i]["HouseCode"].ToString().Trim(); string HouseNo = dtr.Rows[i]["HouseNo"].ToString().Trim(); string HouseId = dtr.Rows[i]["Id"].ToString().Trim(); if (HouseCode_new != HouseNo) { string UdSql = "Update " + TableName + " set HouseNo = '" + HouseCode_new + "' where Id = " + HouseId; UpdateDataReader(UdSql); break; } } } X.Msg.Alert("提示", "修改成功!").Show(); } catch (Exception e) { X.Msg.Alert("提示", "修改失败!" + e.Message).Show(); } } #region 数据处理 public static string strConn = "Data source=localhost;database=HH;user id=sa;pwd=sa;"; public static DataTable GetDataReader(string strSql) { using (SqlConnection connection = new SqlConnection(strConn)) { DataTable dt = new DataTable(); try { SqlDataAdapter command = new SqlDataAdapter(strSql, strConn); connection.Open(); command.Fill(dt); } catch (Exception ex) { connection.Close(); throw new Exception(ex.Message); } finally { connection.Close(); } return dt; } } public static int UpdateDataReader(string strSql) { using (SqlConnection connection = new SqlConnection(strConn)) { DataSet ds = new DataSet(); try { SqlCommand command = new SqlCommand(strSql, connection); connection.Open(); if (command.ExecuteNonQuery() > 0) { return 1; } else { return 0; } } catch (Exception ex) { connection.Close(); throw new Exception(ex.Message); } finally { connection.Close(); } } } #endregion } } 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 鲸 设计师: meimeiellie

分享到微信朋友圈

×

扫一扫,手机浏览