linugb118--java space

Java

easiui2011110902

//editor 绑定click事件
var
ed = $('#tt').datagrid('getEditor', { // get the editor object. index: 2, field: 'name' }); $(ed.target).bind('click', function(){ // bind the click event to editor target element. 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);

            });

posted on 2011-11-09 14:53 linugb118 阅读(290) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航:
 

My Links

Blog Stats

常用链接

留言簿(1)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜