jQuery MiniUI

 找回密码
 立即注册
查看: 1993|回复: 3
打印 上一主题 下一主题

关于DataGrid选中加载的一个问题 [复制链接]

Rank: 1

跳转到指定楼层
楼主
发表于 2014-11-19 15:16:17 |只看该作者 |倒序浏览
<tr id="t6">
                                                                        <th>个人</th>
                                                                        <td>
                                                                                <input id="person" class="mini-lookup" style="width:200px;"  textField="NAME" valueField="ID" popupWidth="auto"
                                                                                        popup="#personGridPanel" grid="#personDatagrid"/>
                                                                                <div id="personGridPanel" class="mini-panel" bodyStyle="padding:0" borderStyle="border:0" style="width:450px;height:250px;"
                                                                                        showToolbar="true" showCloseButton="true" showHeader="false" title="header" iconCls="icon-add"
                                                                                        onselectionchanged="onSelectionChanged"
                                                                                        >
                                                                                        <div property="toolbar" style="padding:5px;padding-left:8px;text-align:center;">   
                                                                                                <span>姓名:</span>   
                                                                                                <input id="keyTextPerson" class="mini-textbox" style="width:160px;"/>
                                                                                                <a class="mini-button">查询</a>      
                                                                                        </div>
                                                                                        <div id="personDatagrid" class="mini-datagrid" style="width:100%;height:100%;"
                                                                                                borderStyle="border:0" showPageSize="false" showPageIndex="false"
                                                                                                multiSelect="false" url="${basePath}tour/ResellerInfoAction!showPersonInfo.action">
                                                                                                <div property="columns">
                                                                                                        <div type="checkcolumn" >#</div>
                                                                                                        <div field="ID"  visible="false" > </div>
                                                                                                        <div field="NAME" width="80" headerAlign="center" allowSort="true" >姓名</div>
                                                                                                        <div field="DEPARTMENT" displayField="DEPARTMENT" width="120" headerAlign="center" autoShowPopup="true" >所在部门
                                                                                                                <input property="editor"  textField="TEXT" valueField="ID" valueFromSelect="true" allowInput="true"  class="mini-combobox" url=""  />
                                                                                                        </div>                                                                                                       
                                                                                                </div>
                                                                                        </div>  
                                                                                </div>       
                                                                        </td>
                                                                </tr>
部门想在onSelectionChanged的事件发生的时候再加载选中人员所在的部门,这个该怎么做?


Rank: 8Rank: 8

沙发
发表于 2014-11-19 15:25:56 |只看该作者
编辑器在开始编辑的时候才创建,你selectionchanged的时候无法改变数据
只有oncellbeginedit事件里面才可以

Rank: 1

板凳
发表于 2014-11-19 16:51:24 |只看该作者
personGrid.on("cellbeginedit",function(e){
            var row=e.record;
            var id = row.ID;
            var actions="${basePath}showPersonDepartment.action?userId="+id;
            $.ajax({
                        url:actions,
                        type:'POST',
                        dataType:'json',
                        success : function(data) {
                                //这个里边该怎么处理才能把List<Map<String,String>>数据在部门的combobox中显示出来?
                        }       
                });
          
        })

Rank: 8Rank: 8

地板
发表于 2014-11-19 16:55:15 |只看该作者
大隋炀帝 发表于 2014-11-19 16:51
personGrid.on("cellbeginedit",function(e){
            var row=e.record;
            var id = row.ID;

var editor=e.editor
success里面
editor.setData(data)   //data需要后台返回的数组数据
另外 ajax设置同步

Archiver|普加软件

GMT+8, 2024-10-7 02:31 , Processed in 1.021639 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部