editGrid自定义列自定义F7
添加自定义列,配置控制自定义F7
自定义F7的地址为连接界面的url
/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.eas.re.sales.settlementTypeF7&waf2skin=easbase&inwafpage=false&debug=true
自定义F7添加一个释放按键事件(模糊搜索)
接收输入的文本模糊搜索并打开F7界面
settlementTypeKeyup:function(event){
var iframeOptions = waf(event.target).wafPromptIframe("option");
var boxOptions = waf(event.target).wafPromptBox("option");
var f7Url = "/easweb/dynamicPage.do?event=initialize&method=doEvent&uipk=com.kingdee.eas.re.sales.settlementTypeF7&waf2skin=easbase&inwafpage=false&debug=true";
var settlement = $(event.target).val();
if(settlement!=null&&settlement.trim()!=""){
var url = f7Url + "&settlement=" +encodeURIComponent(settlement);
waf(event.target).wafPromptIframe("option",'url',url);
if(waf(event.target).wafPromptIframe("hasOpen")){
waf(event.target).wafPromptIframe("close");
}
waf(event.target).wafPromptIframe("open");
waf(event.target).wafPromptIframe("option",'url',f7Url);
}
}
添加一个模型加载功能,接收输入的文本返回前台过滤
1 package com.kingdee.eas.re.sales.receiveGather.handler;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import javax.servlet.http.HttpServletRequest;
7
8 import org.springframework.ui.ModelMap;
9
10 import com.kingdee.bos.eventbus.event.view.AbstractOnRequestEvent;
11 import com.kingdee.bos.webframework.dynamic.application.WebSymbolConstant;
12 import com.kingdee.bos.webframework.dynamic.handler.view.WebPageOnLoadEventHandler;
13 import com.kingdee.bos.webframework.exception.WafException;
14 import com.kingdee.bos.webframework.json.JSONUtils;
15 import com.kingdee.eas.re.sales.web.utils.SalesContext;
16
17 public class SettlementTypeF7PageOnLoadEventHandler extends
18 WebPageOnLoadEventHandler {
19 @Override
20 public void onLoad(AbstractOnRequestEvent event) throws WafException {
21 // TODO Auto-generated method stub
22 HttpServletRequest request = event.getReqeustContext().getHttpServletRequest();
23 Map initData = new HashMap();
24 ModelMap modelMap = event.getReqeustContext().get(ModelMap.class);
25 String uipk = event.getReqeustContext().getHttpServletRequest().getParameter(WebSymbolConstant.UIPK);
26 if(modelMap.get(WebSymbolConstant.PAGE_INITDATA_VAR)!=null){
27 String modelJSONDesc = modelMap.get(WebSymbolConstant.PAGE_INITDATA_VAR).toString();
28 initData = JSONUtils.convertJsonToObject(modelJSONDesc, HashMap.class);
29 }
30 if(SalesContext.getSellProject()!=null){
31 initData.put("sellproject",SalesContext.getSellProject());
32 }
33 String accountParam = request.getParameter("settlement");
34 if(accountParam!=null){
35 initData.put("settlementParam", accountParam);
36 }
37 modelMap.put(WebSymbolConstant.PAGE_INITDATA_VAR, JSONUtils
38 .convertObjectToJson(initData));
39 }
40 }
F7界面加一个页面加载事件(接收输入的文本并搜索)
1 pageOnLoadEvent_after:function(e){
2 var sellProjectid = "";
3 if(_self._pageInitData.sellproject!=null){
4 sellProjectid = _self._pageInitData.sellproject.id;
5 }else{
6 _self.showInfo("请先选择项目");
7 return;
8 }
9 var settlementParam = _self._pageInitData.settlementParam;
10 // _self.getUrlParam('build');
11 var filteritems = "";
12 if(settlementParam&&settlementParam.trim().length>0){
13 filteritems = filteritems + "name like '%"+settlementParam+"%'";
14 }
15 waf("#queryGrid").dataGrid("option","filterItems",filteritems);
16 waf("#queryGrid").dataGrid("reloadGrid");
17 }
F7界面加一个行点击后事件(选中行之后返回选中的数据,并关闭F7界面)
1 rowClick_after:function(rowid,status){
2 var settlementInfo = waf("#queryGrid").wafGrid('getRowRealData', rowid);
3 var returnVal = new Array();
4 // buildInfo.building =buildInfo.name;
5 returnVal.push(settlementInfo);
6 PromptIframeMgr.setReturnValue(returnVal);
7 PromptIframeMgr.close();
8 }