반응형

createdRow: function (row, data, dataIndex, full) {
$(row).attr('id', data.Name);
$(row).attr('name', data.Birth);
},
데이터 테이블 <tr>에 id, name 속성값을 넣어줄 수 있다.
css 등 다른 행위들도 가능하다.
# 해당 <tr>의 <td>에 접근하고 싶다면?
$(row).children('td:nth-child(1)').css('border-left', '2px solid blue');
$(row).children('td:nth-child(3)').attr('class', 'test');
$(row).children('td:nth-child(3)').text();
이런식으로 사용할 수 있다.
createdRow: function (row, data, dataIndex, full) {
// <tr>에 접근하여 속성값 부여하기
$(row).attr('id', data.Name);
$(row).attr('name', data.Birth);
// <tr>의 <td>에 접근하여 조작하기
$(row).children('td:nth-child(1)').css('border-left', '2px solid blue');
$(row).children('td:nth-child(3)').attr('class', 'test');
$(row).children('td:nth-child(3)').text();
},
반응형
'웹 개발' 카테고리의 다른 글
[네이버 지도 api (4)] 주소를 검색해서 지도 이동하기 Geocoding 좌표변환 (14) | 2022.04.27 |
---|---|
sessionStorage vs 전역변수 & Ajax 동기 통신 (0) | 2022.04.26 |
[choicesjs] select 값 초기화하기 choicesjs init , choicesjs 초기화 (0) | 2022.04.06 |
[Safari(ios/mac)] location.href 안될때( 다운로드 안될 때 ) (0) | 2022.03.14 |
[자바스크립트] 페이지 떠날때 데이터 넘기기_ 페이지 이동 시 이벤트 (0) | 2022.02.26 |
댓글