前端代码
// 提交后事件 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 2022-05-06 11:27  天涯何  阅读(74)  评论(0编辑  收藏  举报