//editor 绑定click事件
var ed = $('#tt').datagrid('getEditor', {
index: 2,
field: 'name'
});
$(ed.target).bind('click', function(){
alert('clicked');
});
//editor 绑定回车事件
$('#ttt').datagrid('beginEdit', rowIndex);
var ed = $('#ttt').datagrid('getEditors', rowIndex);
for (var i = 0; i < ed.length; i++)
{
var e = ed[i];
$(e.target).bind('keyup', function()
{
if (window.event.keyCode == 13)
{
alert("you check enter key");
}
});
}
//editor绑定change 事件
function setEditing(tablename,rowIndex) {
var editors = $('#tt').datagrid('getEditors', rowIndex);
var priceEditor = editors[0];
var amountEditor = editors[1];
var sumcount = editors[2];
priceEditor.target.bind('change', function () {
// calculate();
var sum = priceEditor.target.val() * amountEditor.target.val();
alert(sum);
sumcount.attr1.val(sum);
});
amountEditor.target.bind('change', function () {
var sum = priceEditor.target.val() + amountEditor.target.val();
alert(sum);
});