0

请告诉我,我如何从 adminhtml 网格获取/编辑文件。jQuery 没有得到这个字段的值。事件 - 单击行。我尝试编辑“grid.js”。

alert(jQuery("table#productGrid_table tbody>tr>td:nth-child(3)").html)

得不到结果

如果

alert(jQuery(this).html)

结果是

function(a){ifa===b}return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace....

理想情况下我不会使用那个脚本,在简单的桌子上它可以工作

jQuery("table#productGrid_table tbody>tr>td:nth-child(3)").on('click', function(){
    jQuery(this).parent('tr').find('input:checkbox').attr("checked","checked");
    jQuery(this).html("<input type='text' value='"+jQuery(this).text()+"' class='filterInput' autofocus/>");
    }).on('click', 'td input', function(){
        return false;
    }).on('focusout', 'td input', function(){
        jQuery(this).parent('td').text(jQuery(this).val());
});

请有人帮助我,谢谢

4

1 回答 1

0

您没有调用 html 函数 - 添加括号来执行此操作:

// alerts html content from selected node
alert(jQuery("table#productGrid_table tbody>tr>td:nth-child(3)").html())
//                                                                   ^^
于 2012-12-04T12:06:11.803 回答