easiui2011110902

3521 단어

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);

            });

좋은 웹페이지 즐겨찾기