EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: aswzen on September 16, 2016, 12:08:51 AM



Title: Get/set datagrid cell attribute
Post by: aswzen on September 16, 2016, 12:08:51 AM
How to get or set datagrid cell attributes ?

Ex: I want to inject cell attribute with onclick action but don't know how to do it

My best only using cell formatter

Code:
  function formatCel(value,row,index){
        $(this).attr("onclick","alert()");
        return value;
    }
But have no results,

thank you in advance


Title: Re: Get/set datagrid cell attribute
Post by: stworthy on September 16, 2016, 05:14:54 AM
Please use this code instead.
Code:
function formatCel(value,row){
return '<span onclick="javascript:alert()">'+value+'</span>';
}