$(function() { /*================================================================ ¥¹¥¯¥ê¥×¥È¤Ï¤¸¤Þ¤ê ================================================================*/ function init() { // ×î³õ¤Ï¤â¤¦Ã÷ʾµÄ¤Ë¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤òchecked¤Ë¤¹¤ë $('input[type="checkbox"]').each(function(){$(this).prop('checked', true)}); //¥¤¥Ù¥ó¥ÈµÇåh $('input[name="search"]').on("change", onFilterChange); $('input[name="checkall-pdf"]').on("change", onFilterPdfChange); //×î³õ¤ÏÈ«¤Æ³öÁ¦ refleshHtml(allList); } // —ÊË÷¥«¥Æ¥´¥ê¤Î¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤Î’¤„Ó $('input[name="search"]').on("change", function(){ if ($(this).prop('checked') === false) { $(this).removeClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë } else { $(this).addClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤Ä¤±¤ë } }); // —ÊË÷¥«¥Æ¥´¥ê¤Î¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤Î’¤„Ó $('#checkall-pdf').on("change", function(){ if ($('#checkall-pdf').prop('checked') === false) { $('input[name^="main_1_DownloadButton"]').each(function(){ $(this).removeClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë $(this).prop('checked',false)} ); $('input[name^="view_1_DownloadButton"]').each(function(){ $(this).removeClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë $(this).prop('checked',false)} ); } else { $('input[name^="main_1_DownloadButton"]').each(function(){ $(this).addClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë $(this).prop('checked',true)} ); $('input[name^="view_1_DownloadButton"]').each(function(){ $(this).addClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë $(this).prop('checked',true)} ); } }); // pdf¤Î¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤Î’¤„Ó $(document).on("click", 'input[name^="view_1_DownloadButton"]',function(){ thisKey = $(this).attr('value'); if ($('#main_1_DownloadButton-'+thisKey).prop('checked')) { $('input[name^="main_1_DownloadButton"]').each(function(){ if ($(this).attr('id') == 'main_1_DownloadButton-'+thisKey) { $('#main_1_DownloadButton-'+thisKey).prop('checked',false); $('#view_1_DownloadButton-'+thisKey).removeClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë } }); } else { $('input[name^="main_1_DownloadButton"]').each(function(){ if ($(this).attr('id') == 'main_1_DownloadButton-'+thisKey) { $('#main_1_DownloadButton-'+thisKey).prop('checked',true); $('#view_1_DownloadButton-'+thisKey).addClass('js-checked'); // class¤Î¥Á¥§¥Ã¥¯¤ò¤È¤ë } }); } pdfpath = refleshPdfHtmlForCheckbox(allList); $('.button-value').html(pdfpath); }); /*================================================================ HTML³öÁ¦ ================================================================*/ function refleshHtml(list) { var outputHtml = ''; var pdfpath = ''; $('input[name^="main_1_DownloadButton"]').each(function(){ $(this).prop('checked',false)} ); //³öÁ¦¤¹¤ëÄÚÈݤòoutputHtml¤Ë¸ñ¼{ if (list.length > 0) { _.each(list, function(line, i) { /* outputHtml += '