- 注册时间
- 2014-3-14
- 最后登录
- 2024-5-30
- 阅读权限
- 10
- 积分
- 506
- 精华
- 0
- 帖子
- 41
|
Fields1-3是drawcell 的,无法合计,代码如下:
<div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" sizeList="[10,20,50,100]" pageSize="50"
url="BillService.aspx?method=Search" idField="M_No" showSummaryRow="true" >
<div property="columns">
<div type="indexcolumn" ></div>
<div field="M_No" width="80" headerAlign="center" align="center" allowSort="true">单号</div>
<div field="M_Date" width="80" headerAlign="center" align="center" dateFormat="yyyy-MM-dd HH:mm:ss" allowSort="true">日期</div>
<div field="M_SL" width="50" headerAlign="center" align="center" allowSort="true" summaryType="sum">数量</div>
<div field="Fields1" width="50" headerAlign="center" align="center" allowSort="true" summaryType="sum">已付</div>
<div field="Fields2" width="50" headerAlign="center" align="center" allowSort="true" summaryType="sum">到付</div>
<div field="Fields3" width="50" headerAlign="center" align="center" allowSort="true" summaryType="sum">回付</div>
<div field="M_Remarks" width="120" headerAlign="center" align="center" allowSort="true">备注</div>
</div>
</div>
grid.on("drawcell", function (e) {
var record = e.record,
field = e.field;
if (field == "Fields1") {
e.cellHtml = record.M_FS == "1" ? record.M_total : "";
}
if (field == "Fields2") {
e.cellHtml = record.M_FS == "2" ? record.M_total : "";
}
if (field == "Fields3") {
e.cellHtml = record.M_FS == "3" ? record.M_total : "";
}
});
|
|