EasyUI Forum
May 14, 2024, 08:36:07 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Get/set datagrid cell attribute  (Read 5612 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« 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
Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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>';
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!