Javascript 如何从网格获取/编辑字段(adminhtml)
请告诉我,我如何从adminhtml网格获取/编辑文件。jQuery无法获取此字段的值。事件-单击行。我尝试编辑“grid.js” 没有结果 如果 结果是Javascript 如何从网格获取/编辑字段(adminhtml),javascript,magento,Javascript,Magento,请告诉我,我如何从adminhtml网格获取/编辑文件。jQuery无法获取此字段的值。事件-单击行。我尝试编辑“grid.js” 没有结果 如果 结果是 function(a){ifa===b}return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace.... 理想情况下,我不会使用那个脚本,在简单的表上它是有效的 jQuery("table#productGrid_table tbody>tr>t
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());
});
jQuery(“table#productGrid_table tbody>tr>td:nth child(3)”。在('click',function()上{
jQuery(this).parent('tr').find('input:checkbox').attr(“checked”,“checked”);
jQuery(this.html)(“”);
}).on('click','td input',function(){
返回false;
}).on('focusout','td input',function(){
jQuery(this.parent('td').text(jQuery(this.val());
});
请帮帮我,thx您没有调用html函数-请添加括号:
// alerts html content from selected node
alert(jQuery("table#productGrid_table tbody>tr>td:nth-child(3)").html())
// ^^
您想完成什么?我尝试从adminhtml网格编辑产品名称(单击字段,重命名)
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());
});
// alerts html content from selected node
alert(jQuery("table#productGrid_table tbody>tr>td:nth-child(3)").html())
// ^^