본문 바로가기

jQuery/w2ui

[w2ui] 그리드(Gride)의 상세검색 한글로 변환하기

반응형

■ w2ui 그리드(Gride)의 상세검색 한글로 변환하기




01. we2ui의 검색조건을 한글로 바꿀려면 *.js파일을 수정해야 한다. getSearchesHTML: function ()을 검색한뒤

   아래와 같은 영역에 한글로 지정했다.

 w2ui-1.4.3.js

getSearchesHTML: function () {
            var html = '<table cellspacing="0">';
            var showBtn = false;
            for (var i = 0; i < this.searches.length; i++) {
                var s = this.searches[i];
                s.type = String(s.type).toLowerCase();
                if (s.hidden) continue;
                var btn = '';
                if (showBtn == false) {
                    btn = '<button class="btn close-btn" onclick="obj = w2ui[\''+ this.name +'\']; if (obj) { obj.searchClose(); }">X</button';
                    showBtn = true;
                }
                if (typeof s.inTag   == 'undefined') s.inTag     = '';
                if (typeof s.outTag  == 'undefined') s.outTag     = '';
                if (typeof s.type    == 'undefined') s.type     = 'text';
                if (['text', 'alphanumeric', 'combo'].indexOf(s.type) != -1) {
                    var operator =  '<select id="grid_'+ this.name +'_operator_'+ i +'" onclick="event.stopPropagation();">'+
                        '    <option value="is">'+ w2utils.lang('~인(is)') +'</option>'+
                        '    <option value="begins">'+ w2utils.lang('시작단어~(begins)') +'</option>'+
                        '    <option value="contains">'+ w2utils.lang('~내용~(contains)') +'</option>'+
                        '    <option value="ends">'+ w2utils.lang('~마지막단어(ends)') +'</option>'+
                        '</select>';
                }
                if (['int', 'float', 'money', 'currency', 'percent', 'date', 'time'].indexOf(s.type) != -1) {
                    var operator =  '<select id="grid_'+ this.name +'_operator_'+ i +'" '+
                        '        onchange="w2ui[\''+ this.name + '\'].initOperator(this, '+ i +');" onclick="event.stopPropagation();">'+
                        '    <option value="is">'+ w2utils.lang('~인(is)') +'</option>'+
                        (['int'].indexOf(s.type) != -1 ? '<option value="~인(in)">'+ w2utils.lang('이면서(in)') +'</option>' : '') +
                        (['int'].indexOf(s.type) != -1 ? '<option value="~이 아닌(not in)">'+ w2utils.lang('제외한(not in)') +'</option>' : '') +
                        '<option value="between">'+ w2utils.lang('~중에서(between)') +'</option>'+
                        '</select>';
                }
                if (['select', 'list', 'hex'].indexOf(s.type) != -1) {
                    var operator =  '<select id="grid_'+ this.name +'_operator_'+ i +'" onclick="event.stopPropagation();">'+
                        '    <option value="is">'+ w2utils.lang('is') +'</option>'+
                        '</select>';
                }
                if (['enum'].indexOf(s.type) != -1) {
                    var operator =  '<select id="grid_'+ this.name +'_operator_'+ i +'" onclick="event.stopPropagation();">'+
                        '    <option value="~인(in)">'+ w2utils.lang('in') +'</option>'+
                        '    <option value="~이 아닌(not in)">'+ w2utils.lang('not in') +'</option>'+
                        '</select>';
                }
                html += '<tr>'+
                        '    <td class="close-btn">'+ btn +'</td>' +
                        '    <td class="caption">'+ s.caption +'</td>' +
                        '    <td class="operator">'+ operator +'</td>'+
                        '    <td class="value">';



위와같이 변경했다면 상세 검색 내 부분이 한글로 변경되어 있을 것이다.

반응형