jquery - add attribute to a <th> without id or class -
i want add attribute table header without id or class. has field. code here not work. appreciate help
$(th[field = "item_group_id"]).attr('hidden', 'true');
or there other way can this? heres table
<table id="dg" title="jaiko pogi " class="easyui-datagrid" style="width:980px;height:370px;" url="show_biochem.php" toolbar="#toolbar" pagination="true" rownumbers="false" fitcolumns="true" singleselect="true" height="auto";> <thead> <tr> <th field="item_group_id" width="8">id</th> </tr> </thead> </table>
solved it. read documentation , turns out there function this. anyway help
$('#dg').datagrid('hidecolumn','item_group_id');
your selector incorrect. should string:
$('th[field="item_group_id"]').attr('hidden', 'true');
also, trying hide element? if so, adding attribute called "hidden" won't it.. try instead:
$('th[field="item_group_id"]').hide();
Comments
Post a Comment