본문 바로가기

javascript/w2ui

w2ui grid cell background-color 배경색상 변경

w2ui grid cell background-color 배경색상 변경 방법.

 

엄청 오래걸렸음. 해결해서 다행.

<div id="grid" style="width:400px; height: 350px;"></div>
$('#grid').w2grid({
        name: 'grid',
        columns: [
            { recid:1, field: 'fname', text: 'First Name', size: '30%' },
            { recid:2, field: 'lname', text: 'Last Name', size: '70%' },
            { recid:3, field: 'sdate', text: 'Dates', size: '120px', attr: "align=center" }
        ],
        records: [
          {recid: 1, fname:'kim', lname:'LastName', sdate:'2022-05-30', 
            w2ui : { 'style' : 'background-color: #adcaf7;' }
          } //END recid 1
          ,
          {recid: 2, fname:'choi', lname:'LastName', sdate:'2022-05-30', 
            w2ui : {
              'style' : { lname :  'background-color: #fffecc;'}
              } //END w2ui
          } //END recid 2
        ] //END records
});

 

https://codepen.io/dyun/pen/wvymrMP

 

w2ui_cell_background-color

...

codepen.io

참고 :

1) https://jsfiddle.net/api/post/jquery/3.4/

2) https://w2ui.com/web/demos/#/grid/29

3) https://stackoverflow.com/questions/38696758/add-custom-color-to-w2ui-cell-grid

 

 

728x90
300x250