$("#grid").kendoGrid({
dataSource: dataSrc,
//toolbar: ["save", "取消"],
columns: [
{
width: 70,
title: "请购承办",
template: '#= ""+ask_man+"" #'
},
{
width: 70,
title: "联系方式",
template: '#= ""+ask_man_contact+"" #'
}
],
change: function (e) {
//原产地、交货天数、制造厂商等字段如果有指定的值,则不能输入
set_input_disabled();
},
edit: function(e) {
  

//if (!e.model.isNew()) {
// Disable the editor of the "id" column when editing data items
//var numeric = e.container.find("input[name=unit_price]").data("kendoNumericTextBox");
var numeric = e.container.find("input[name=unit_price]");
numeric.keyup(function (k) {
if (/^[\d\.]?$/.test(k.char) == false && (k.char != '\b') && (k.key != 'Left') && (k.key != 'Right')) {
alert('请输入正确的金额!');
$(this).val('0');
return false;
}
});
numeric.blur(function () {
var unitprice = parseFloat(this.value);
var taxrate = parseFloat(/\d+/.exec(e.container.next().html())[0]);
var oTaxRate = e.container.next().find('input[name="tax_rate"]');
if (oTaxRate && oTaxRate.length > 0) {
taxrate = parseFloat(oTaxRate.attr('aria-valuenow'));
}
var tax = unitprice * taxrate / 100;
e.container.next().next().html(tax);//税金
var num = parseInt(e.container.prev().prev().prev().html());//数量
e.container.next().next().next().html(num * unitprice);//总金额
});
var manufacturers = e.container.find("input[name=manufacturers]");
manufacturers.keypress(function () {
if (this.value != '') {
alert('制造厂商已指定,不能再修改!');
return false;
}
});
var country_of_origin = e.container.find("input[name=country_of_origin]");
country_of_origin.keypress(function () {
if (this.value != '') {
alert('原产地已指定,不能再修改!');
return false;
}
});

},
editable: true,
sortable: false,
pageable: false,
selectable: "multiple",
dataBound: function () {

}

});

最新文章

  1. ES6+ 现在就用系列(二):let 命令
  2. JavaScript函数柯里化
  3. (3)JSTL的fn方法库
  4. ftp的20 21端口和主动被动模式
  5. Helpers\Sessions
  6. CSS layout入门
  7. Day22 JSONP、瀑布流
  8. swift代码排版-参考
  9. [LeetCode]题解(python):002-Add Two Numbers
  10. 用golang写的 分解x86 intel boot/recovery工具
  11. Modbus总结
  12. NetFPGA-1G-CML Demo --- reference_router_nf1_cml
  13. CodeForces 1151D Stas and the Queue at the Buffet
  14. oracle 11.2.0.4 rac 修改 ip vip scan ip
  15. mysql基础整理01
  16. 存储过程数据insert into select
  17. LINK : fatal error LNK1104: cannot open file .exe' 重开application Experience 服务即可
  18. cf860E Arkady and A Nobody-men (树剖)
  19. 英文谚语:Take that with a grain of salt
  20. C# CashCode项目开发

热门文章

  1. 'mysql' 不是内部或外部命令,也不是可运行的程序或批处理文件的解决办法
  2. 怎么让CentOS集群自动同步时间
  3. 【转载】CCombobox使用大全
  4. linux杀掉80端口线程命令
  5. hdu 1757 A Simple Math Problem (矩阵快速幂,简单)
  6. android音乐播放器开发教程
  7. IOS 视图控制对象生命周期-init、viewDidLoad、viewWillAppear、viewDidAppear、viewWillDisappear等的区别及用途
  8. 小米2S 连接Ubuntu Android Studio
  9. Sina App Engine(SAE)教程(11)- Yaf使用
  10. 向ArcMap添加未出现的工具 如planarize lines