|
当输入59时,按回车,很正常
当再次输入60时,这时还没按回车
当按回车时,60却变成60.0001了
- @(F.Window()
- .Width(350)
- .WindowPosition(WindowPosition.GoldenSection)
- .EnableClose(false)
- .IsModal(false)
- .IsViewPort(true)
- .Title("测试")
- .ID("Window1")
- .Items(
- F.Grid()
- .Title("BugTest")
- .ID("BugTest")
- .Height(500)
- .Width(500)
- .Listener("dataload", "onCreatRow")
- .AllowCellEditing(true)
- .ClicksToEdit(1)
- .Columns(
- F.RenderField()
- .ColumnID("Price")
- .HeaderText("单价")
- .HeaderTextAlign(TextAlign.Center)
- .Width(90)
- .Editor(
- F.NumberBox()
- .NoDecimal(false)
- .NoNegative(true)
- //.EnableRound(true)
- .DecimalPrecision(4)
- .ShowTrigger(false)
- .Required(true)
- ),
- F.RenderField()
- .ColumnID("TaxPrice")
- .HeaderText("含税单价")
- .HeaderTextAlign(TextAlign.Center)
- .Width(90)
- .Editor(
- F.NumberBox()
- .NoDecimal(false)
- .NoNegative(true)
- //.EnableRound(true)
- .DecimalPrecision(4)
- .ShowTrigger(false)
- .Required(true)
- )
-
- )
- .Listener("afteredit", "onCalculate")
- )
- )
复制代码- <script>
- function onCreatRow() {
- var records = [];
- for (var i = 0; i < 10; i++) {
- records.push({
- //'': ''
- });
- }
- // 此过程禁止触发事件,防止 dataload 事件死循环
- F.noEvent(function () {
- F.ui.BugTest.addNewRecords(records, true);
- });
- }
- function onCalculate(event, value, params) {
- var me = this, columnId = params.columnId, rowId = params.rowId;
- var Price = me.getCellValue(rowId, 'Price');
- var TaxPrice = me.getCellValue(rowId, 'TaxPrice');
- if (columnId === 'Price') {
- TaxPrice = Price * (1 + 10 / 100);
- me.updateCellValue(rowId, 'TaxPrice', TaxPrice.toFixed(4));
- }
- if (columnId === 'TaxPrice') {
- Price = TaxPrice / (1 + 10 / 100);
- me.updateCellValue(rowId, 'Price', Price.toFixed(4));
- }
- }
- </script>
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|