随笔 - 95,  文章 - 0,  评论 - 0,  阅读 - 14253

前端代码
// 提交后事件 AfterSubmit: function( action, responseValue ) {
//
addStage 按钮控件




if( action == "addStage" ) { $.SmartForm.PostForm( "getStage", { isStage: "1" }, function( data ) { //alert( JSON.stringify( data.ReturnData[ "dataList" ] ) ); var data1 = data.ReturnData[ "dataList" ]; // debugger if( data1 != null ) { that.addStage.SetVisible( false ); var details = that.D000772F06847ec1bd334b93a905fdc3049187e6; details.ClearRows(); var result = data1; if( result != null || result.length > 0 ) { for( i = 0;i < result.length;i++ ) { var controlManager = that.D000772F06847ec1bd334b93a905fdc3049187e6;//获取子表控件对象 var subObjectId = $.IGuid(); //创建行ID  debugger controlManager.AddRow( subObjectId, { "D000772F06847ec1bd334b93a905fdc3049187e6.workDetail": result[ i ], }) } } } }, function( data ) { $.IShowWarn( "异常,请联系管理员" ); }, false ); }
复制代码
 
//后端代码,连接前端代码
protected override void OnSubmit(string actionName, H3.SmartForm.SmartFormPostValue postValue, H3.SmartForm.SubmitSmartFormResponse response) { if(actionName == "getStage") { response.ReturnData = new Dictionary<string, object>(); String isStage = this.Request["isStage"] + String.Empty; response.ReturnData.Add("dataList", selectSon(isStage)); } base.OnSubmit(actionName, postValue, response); } public List < string > selectSon(String isStage) { List < string > objectIdList = new List<string>(); if(isStage == "1") { //查询项目阶段子表 //string sql = "SELECT * FROM I_D000772Fkmjm7ijwd1ilmhr6yst8ige86 ORDER BY sort ASC";
      //有过滤条件的查询值
         string sql = "SELECT * FROM I_D000772Fkmjm7ijwd1ilmhr6yst8ige86 where parentobjectid='" + this.Request["projectNum1"] + "'ORDER BY sort ASC ";
// string sql = "select * from I_D000772Fkmjm7ijwd1ilmhr6yst8ige86 ORDER BY sort DESC"; System.Data.DataTable dtAccount = this.Request.Engine.Query.QueryTable(sql, null); if(dtAccount != null || dtAccount.Rows.Count > 0) { for(int i = 0;i < dtAccount.Rows.Count; i++) { objectIdList.Add(dtAccount.Rows[i]["objectId"] + string.Empty); } } } return objectIdList; }
复制代码

 前端传值变化 后端加过滤项目条件,拿不到页面的值,需要从前端传一个值过去

 

 

posted on   天涯何  阅读(79)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示