hyling 发表于 2022-3-10 10:34:24

group分组表格是否可编辑?

group分组表格单元格是否可编辑?
加属性 allowCellEdit="true" 不起作用,还是不可编辑



<div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;"
    url="../../demo/data/AjaxService.aspx?method=SearchEmployees"  idField="id" allowResize="true"
    ondrawgroup="onDrawGroup" allowCellEdit="true"
        allowCellSelect="true" showColumnsMenu="true" collapseGroupOnLoad="false" enableGroupOrder="false"
    groupTitleCollapsible="false" showGroupSummary="true" showSummaryRow="true" summaryPosition="top"
>



happylover1278 发表于 2022-3-10 10:38:20

添加编辑器了么

hyling 发表于 2022-3-10 11:20:34

happylover1278 发表于 2022-3-10 10:38 static/image/common/back.gif
添加编辑器了么

应该加了,你帮我看看代码,谢谢
<body>
    <h1>Grouping 分组表格</h1>

    <div style="padding-bottom:5px;">
        <span>员工姓名:</span><input type="text" id="key"  />
        <input type="button" value="查找" onclick="search()"/>
    </div>

<div id="datagrid1" class="mini-datagrid" style="width:700px;height:280px;"
    url="../../demo/data/AjaxService.aspx?method=SearchEmployees"  idField="id" allowResize="true" allowCellEdit="true"
    ondrawgroup="onDrawGroup"  showColumnsMenu="true" collapseGroupOnLoad="false" enableGroupOrder="false"
    groupTitleCollapsible="false" showGroupSummary="true" showSummaryRow="true" summaryPosition="top"
>
    <div property="columns">
        <div type="indexcolumn"></div>
        
      <div  name="LoginName"  field="loginname" width="120" headerAlign="center" allowSort="true">员工帐号
      <input property="editor" class="mini-textbox" style="width:100%;" minWidth="200" />
      </div>
      
      
      
        <div field="name" width="120" headerAlign="center" allowSort="true">姓名
      <input property="editor" class="mini-textbox" style="width:100%;" minWidth="200" />
      </div>                           
        <div  field="gender" width="100" renderer="onGenderRenderer" align="center" headerAlign="center">性别
      <input property="editor" class="mini-textbox" style="width:100%;" minWidth="200" /></div>
        <div  field="salary" width="100" allowSort="true" summaryType="avg" dataType="currency" currencyUnit="¥">薪资
      <input property="editor" class="mini-textbox" style="width:100%;" minWidth="200" /></div>                                    
        <div  field="age" width="100" allowSort="true" summaryType="max">年龄
      <input property="editor" class="mini-textbox" style="width:100%;" minWidth="200" /></div>
        <div  field="createtime" width="100" headerAlign="center" dateFormat="yyyy-MM-dd" allowSort="true">创建日期
      <input property="editor" class="mini-textbox" style="width:100%;" minWidth="200" /></div>
    </div>
</div>   
   
   

hyling 发表于 2022-3-10 11:27:14

happylover1278 发表于 2022-3-10 10:38 static/image/common/back.gif
添加编辑器了么

我是拿官网的案例在线改的
http://www.miniui.com/demo/#src=datagrid/grouping.html

happylover1278 发表于 2022-3-10 11:41:36

hyling 发表于 2022-3-10 11:20 static/image/common/back.gif
应该加了,你帮我看看代码,谢谢
缺了一个属性  allowCellSelect="true"允许编辑的前提是能选中

hyling 发表于 2022-3-10 12:10:11

happylover1278 发表于 2022-3-10 11:41 static/image/common/back.gif
缺了一个属性  allowCellSelect="true"允许编辑的前提是能选中

可以了,谢谢

hyling 发表于 2022-3-10 12:32:55

本帖最后由 hyling 于 2022-3-10 14:26 编辑

happylover1278 发表于 2022-3-10 11:41 static/image/common/back.gif
缺了一个属性  allowCellSelect="true"允许编辑的前提是能选中
怎么选中某个分类,进行新增明细数据呢?用addRow只能在第一个分类下面进行新增数据
<a class="mini-button" iconCls="icon-add" onclick="addRow()" plain="true" tooltip="增加...">增加</a>
function addRow() {         
            var newRow = { name: "New Row" };
            grid.addRow(newRow, 0);

            grid.beginEditCell(newRow, "LoginName");
        }


felt 发表于 2022-3-16 16:31:14

hyling 发表于 2022-3-10 12:32 static/image/common/back.gif
怎么选中某个分类,进行新增明细数据呢?用addRow只能在第一个分类下面进行新增数据




添加之后重新分组
页: [1]
查看完整版本: group分组表格是否可编辑?