4, js 코드에서 엘 표현식의 내용을 가져와 수조를 반복한다

1671 단어

    $(function() {
        //  TITLE_STANDARD_RED List<Object>    
        var titleStanadradRedArray = new Array();  
        <c:forEach items="${sessionScope[title_standard_red]}" var="each">  
            var eachObj = new Object();
            eachObj.value = '${each.value}';
            eachObj.memo = '${each.memo}';
            titleStanadradRedArray.push(eachObj); //js , EL push   
        </c:forEach>
        
        //  , list   
        for(var i = 0; i < '${fn:length(FIND_MAPPING_BY_SHEETID)}'; i++) {
            var selectStandradName = $('#selectStandradName' + i.toString()).val();
            console.log('selectStandradName:' + selectStandradName);
            var label = $('#label' + i.toString()).val();
            if(selectStandradName == null) {
                //  , 
                $('#label' + i.toString()).css('color', 'red');
                $('#selectStandradName' + i.toString()).css('color', 'red');
                //  verifyFlag 1
                $('#verifyFlag' + i.toString()).val('1');
                //  , 
                $('#selectStandradName' + i.toString()).empty();
                $('#selectStandradName' + i.toString()).append('<option disabled selected="selected"> </option>');
                for(var j = 0; j < '${fn:length(sessionScope[title_standard_red])}'; j++) {
                    $('#selectStandradName' + i.toString()).append('<option value="'+titleStanadradRedArray[j].value+'">'+titleStanadradRedArray[j].memo+'</option>');
                }
            }
        }
    })

좋은 웹페이지 즐겨찾기