jQuery MiniUI

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

datagrid里的下拉框值怎么改变 [复制链接]

Rank: 6Rank: 6

跳转到指定楼层
楼主
发表于 2017-11-2 11:30:00 |只看该作者 |倒序浏览
  1.    <div id="zhyw_xcgzfgl" class="mini-datagrid" style="height: 100%;" data-options="{canImport:true}"
  2.                                     allowCellEdit="true" allowCellSelect="true" multiSelect="true"   
  3.                                      idfield="Id" allowresize="true" allowcelledit="true" allowcellselect="true"   oncellcommitedit="OnCellCommitEdit"
  4.         oncellbeginedit="OnCellBeginEdit"    >
复制代码
  1. <div field="gg" headeralign="center" width="150">规格<input property="editor" class="mini-combobox"  data="aaa"    valueField="id" textField="text"   style="width: 100%;"  /></div>
  2.                                        
复制代码
  1.     var aaa = [];

  2.     function OnCellBeginEdit(e) {
  3.             var grid = e.sender;
  4.             var record = e.record;
  5.             var field = e.field, value = e.value;
  6.             if (field == "gg") {
  7.                 aaa = [{ id: '162', text: '162' }, { id: '163', text: '163' }, { id: '170', text: '170' }, { id: '175', text: '175' }, { id: '180', text: '180' }, { id: '185', text: '185' }, { id: '190', text: '190' }, { id: '195', text: '195'}];
  8.             }
  9.         }
复制代码
怎么不管用
我是参照这个弄的,是我改变了aaa的值之后还要执行什么刷新之类的操作么
http://www.miniui.com/demo/#src=datagrid/celllinkedit.html

Rank: 8Rank: 8

沙发
发表于 2017-11-2 13:13:57 |只看该作者
<div field="gg"  displayField="gg_name" headeralign="center" width="150">规格<input property="editor" class="mini-combobox"  data="aaa"    valueField="id" textField="text"   style="width: 100%;"  /></div>
        
  function OnCellBeginEdit(e) {
            var grid = e.sender;
            var record = e.record;
            var field = e.field, value = e.value;
            if (field == "gg") {
                aaa = [{ id: '162', text: '162' }, { id: '163', text: '163' }, { id: '170', text: '170' }, { id: '175', text: '175' }, { id: '180', text: '180' }, { id: '185', text: '185' }, { id: '190', text: '190' }, { id: '195', text: '195'}];
          e.editor.setData(aaa);
            }
        }

Archiver|普加软件

GMT+8, 2024-10-3 03:25 , Processed in 1.069800 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部