jQuery MiniUI

标题: datagrid里的下拉框值怎么改变 [打印本页]

作者: 冰是睡着的雪    时间: 2017-11-2 11:30:00     标题: datagrid里的下拉框值怎么改变

  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


作者: felt    时间: 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);
            }
        }




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