jQuery MiniUI

标题: combobox联动传参数问题 [打印本页]

作者: pxl2014    时间: 2017-9-27 14:13:50     标题: combobox联动传参数问题

联动第一级列表
<input name="GameKindClass" style="width: 136px;" required="true" class="mini-combobox" textfield="value" valuefield="key" allowinput="false" shownullitem="false" emptytext="-请选择游戏分类-" nullitemtext="-请选择游戏分类-" ajaxType="post" ajaxOptions="{type:'post',async:false,data:{},dataType:'json',contentType:'application/x-www-form-urlencoded;charset=utf-8'}" url="/api/EnumManagerApi/GetGameKindTypeList" />
联动第二级列表
<input name="KindID" class="mini-combobox" style="width: 136px;" textfield="KindName" valuefield="KindID" allowinput="false" shownullitem="false" emptytext="-请选择游戏类型-" nullitemtext="-请选择游戏类型-" required="true" ajaxType="post" ajaxOptions="{type:'post',async:false,data:{},dataType:'json',contentType:'application/x-www-form-urlencoded;charset=utf-8'}" />


怎么根据 GameKindClass 中选择的值联动 KindID 中的值;我访问地址后边不能跟参数,联动的时候怎么使用ajaxOptions的data进行参数传递

作者: felt    时间: 2017-9-27 15:03:34

可以监听第二个combobox的onbeforeload事件
mini.get("KindID").on("beforeload",function(e){
      e.data.a=e.sender.type;
      e.data.b=e.sender.async;
     .....
})
作者: pxl2014    时间: 2017-9-27 15:11:17

felt 发表于 2017-9-27 15:03
可以监听第二个combobox的onbeforeload事件
mini.get("KindID").on("beforeload",function(e){
      e.dat ...

e.data.a=e.sender.type;
      e.data.b=e.sender.async;
     .....


这个能不能详细说明下,没看懂
作者: felt    时间: 2017-9-27 15:36:25

pxl2014 发表于 2017-9-27 15:11
e.data.a=e.sender.type;
      e.data.b=e.sender.async;
     .....

你想传什么参数,遮住眼放在ajaxOptions里面,url加载的时候会自动带上,但是type的话需要单独ajaxType="post"
另外onbeforeload事件里可以添加参数
e.data.a   //后台可以request[“a"]
作者: pxl2014    时间: 2017-9-27 16:00:28

felt 发表于 2017-9-27 15:36
你想传什么参数,遮住眼放在ajaxOptions里面,url加载的时候会自动带上,但是type的话需要单独ajaxType=" ...

谢谢,处理好了




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2