{"id":5753,"date":"2025-02-13T17:32:05","date_gmt":"2025-02-13T10:32:05","guid":{"rendered":"https:\/\/www.nesdc.go.th\/the-national-economic-and-social-development-plan\/the-twelfth-plan\/"},"modified":"2025-03-20T02:13:39","modified_gmt":"2025-03-19T19:13:39","slug":"the-twelfth-plan","status":"publish","type":"page","link":"https:\/\/www.nesdc.go.th\/en\/the-national-economic-and-social-development-plan\/the-twelfth-plan\/","title":{"rendered":"The Twelfth Plan (2017-2021)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"5753\" class=\"elementor elementor-5753 elementor-635\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2f81bb8 e-flex e-con-boxed e-con e-parent\" data-id=\"2f81bb8\" data-element_type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ea45a24 notitlesh elementor-widget elementor-widget-shortcode\" data-id=\"ea45a24\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><div id=\"table_title\" class=\"d-none\">The Twelfth Plan<\/div>\n<div id=\"table_description\" class=\"d-none\"><\/div>\n<div class=\"container display_type0 shortcode\">\n    <div class=\"row\">\n        <div class=\"dl-main\">\n\t\t\t        <\/div>\n    <\/div>\n<\/div>\n<script>\njQuery(function($){\n\tvar $img_src = '';\n\tvar $file_src = '';\n\tvar display_type = 0;\n\t\/* initial datatable - share setting *\/\n\t$.extend( $.fn.dataTable.defaults, {\n\t\t\/\/responsive: true,\n\t\tsearching: true,\n\t\tdestroy: true,\n\t\t\/*rowReorder:{\n\t\t\tselector: 'td:nth-child(8)'\n\t\t},*\/\n\t\torder:[['last_updated', 'desc'], ['col_title', 'asc']],\n\t\tlengthMenu: [ \n\t\t\t[ 10, 20, 50, 100, -1 ], \n\t\t\t[ \"10\", \"20\", \"50\", \"100\", \"All\"] \n\t\t],\n\t\tlanguage: {\n\t\t\t\/\/lengthMenu: 'Rows per page: '.[20, 30, 50, 75, 100];\n\t\t\t\/\/lengthMenu: 'Rows per page: _MENU_ ',\n\t\t\tlengthMenu: 'Rows per page: _MENU_ ',\n\t\t\tinfo: '_START_ - _END_ of _TOTAL_',\n\t\t\tsearch: '<i class=\"icon-search\"><\/i>',\n\t\t\tsearchPlaceholder: \"keyword\"\t\t},\n\t\tpagingType: 'simple_numbers',\n\t\tajax: {\n            url: 'https:\/\/www.nesdc.go.th\/wp-json\/data\/v1\/downloads?category=the-twelfth-plan-en',\n\t\t\t\"dataSrc\": function (json) {\n\t\t\t  return json;\n\t\t\t}\n        },\n\t});\n\t\n\tif(display_type == '1' || display_type == '2' || display_type == '3' || display_type == '5' || display_type == '12'){\n\t\tvar table1 = jQuery('#dataTable').DataTable( {\n\t\t\tdom: '<\"#table_top\"<\"#dropdown1\"><\"#dropdown2\"><\"top_search\"f>><\"tb-main-wrapper\"<t><\"tb_bottom\"ilp>>',\n\t\t\t\/\/pageLength: 2,\n\t\t\tcolumns: [\n\t\t\t\t{ title: 'No.',     data: 'ID', className: 'col_id'  },\n\t\t\t\t{ title: 'Title',  data: 'thumb', className: 'col_thumb' },\n\t\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t\t{ title: 'Download', \tdata: 'download_file', className: 'col_file' },\n\t\t\t\t{ title: 'Reference',   data: 'department',  className: 'col_department' },\n\t\t\t\t{ title: 'Document Download', \tdata: 'download_count', className: 'col_download' },\n\t\t\t\t{ title: 'CATEGORY',   data: 'category', className: 'col_category' },\n\t\t\t\t{ title: 'YEAR',   data: 'year', className: 'col_year' },\n\t\t\t\t{ title: 'Upload',   data: 'download_url', className: 'col_upload'  },\n\t\t\t\t{ title: 'Published', \tdata: 'last_updated', className: 'last_updated' },\n\t\t\t],\n\t\t\tcreatedRow: function (row, data, dataIndex) \n\t\t\t{\n\t\t\t\t$(row).addClass('file_count' + data.no_download_item);\n\t\t\t},\n\t\t\tcolumnDefs: [\n\t\t\t\t{\n\t\t\t\t\trender: (data, type, row) => data + '' + row[\"download_url\"],\n\t\t\t\t\ttargets: 3\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttargets: 1,\t\n\t\t\t\t\tdata: 'thumb',\n\t\t\t\t\trender: function (data, type, row, meta) {\n\t\t\t\t\t\tif(data == 'x'){\n\t\t\t\t\t\t\treturn '<span class=\"placeholder_img\" title=\"'+row[\"name\"]+'\"><\/span>';\n\t\t\t\t\t\t}else if(data == ''){\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn '<img decoding=\"async\" src=\"' + data + '\" class=\"img-fluid wp-post-image\" alt=\"'+row[\"name\"]+'\" aria-label=\"'+row[\"name\"]+'\" title=\"'+row[\"name\"]+'\"role=\"presentation\">';\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\/\/{ visible: false, targets: [5,8] }\n\t\t\t],\n\t\t\tinitComplete: function() {\n\t\t\t\tconst table = this.api();\n\t\t\t\tvar table_title = jQuery(\"#table_title\").html();\n\t\t\t\tvar table_description = jQuery(\"#table_description\").html();\t\t\n\t\t\t\t\n\t\t\t\tif(display_type == '3' || display_type == '4' || display_type == '5'){\n\t\t\t\t\tjQuery('#dataTable_wrapper').prepend(\"<h4>\"+table_title+\"<\/h4>\" + \"<div class='top_cat_desc'>\"+table_description+\"<\/div>\");\n\t\t\t\t}else{\n\t\t\t\t\tjQuery('.top_search').prepend(\"<h4>\"+table_title+\"<\/h4>\" );\n\t\t\t\t\tjQuery('#table_top').append(\"<div class='top_cat_desc'>\"+table_description+\"<\/div>\");\n\t\t\t\t}\n\t\t\t\taddAriaClasses(table);\n\t\t\t},\n\t\t});\n\t\tif(display_type == '3' || display_type == '5'){\n\t\t\tbuildSelect(table1);\n\t\t\ttable1.on('draw', function() {\n\t\t\t\t\tbuildSelect(table1);\n\t\t\t});\n\t\t}\n\t}else if(display_type == '4'){\n\t\tvar table1 = jQuery('#dataTable').DataTable( {\n\t\t\tdom: '<\"#table_top\"<\"top_search\"f>><\"tb-main-wrapper\"<t><\"tb_bottom\"ilp>>',\n\t\t\tcolumns: [\n\t\t\t\n\t\t\t\t{ title: 'No.',     data: 'ID', className: 'col_id' },\n\t\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t\t{ title: 'Download', \tdata: 'download_file', className: 'col_file' },\n\t\t\t\t{ title: 'Upload',   data: 'download_url', className: 'col_upload' },\n\t\t\t\t{ title: 'Published', \tdata: 'last_updated', className: 'last_updated' },\n\t\t\t],\n\t\t\tcreatedRow: function (row, data, dataIndex){\n\t\t\t\t$(row).addClass('file_count' + data.no_download_item);\n\t\t\t},\n\t\t\tcolumnDefs: [\n\t\t\t\t{\n\t\t\t\t\trender: (data, type, row) => data + '' + row[\"download_url\"],\n\t\t\t\t\ttargets: 2\n\t\t\t\t},\n\t\t\t],\n\t\t\tinitComplete: function() {\n\t\t\t\tconst table = this.api();\n\t\t\t\tvar table_title = jQuery(\"#table_title\").html();\n\t\t\t\tvar table_description = jQuery(\"#table_description\").html();\n\t\t\t\tjQuery('.top_search').prepend(\"<h4>\"+table_title+\"<\/h4>\");\n\t\t\t\tjQuery('#table_top').append(\"<div class='top_cat_desc'>\"+table_description+\"<\/div>\");\n\t\t\t\taddAriaClasses(table);\n\t\t\t},\n\t\t});\n\t}else if(display_type == '10'){\n\t\tvar table1 = $('#dataTable').DataTable({\n\t\tdom: '<\"#table_top\"<\"top_search\"f>><\"tb-main-wrapper\"<t><\"tb_bottom\"ilp>>',\n\t\tcolumns: [\n\t\t\t{ title: 'No.',     data: 'ID', className: 'col_id'  },\n\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t{ title: 'Download', \tdata: 'download_file', className: 'col_file' },\n\t\t\t{ title: 'Download Document', \tdata: 'download_count', className: 'col_download' },\n\t\t\t{ title: 'Upload',   data: 'download_url', className: 'col_upload'  },\n\t\t\t{ title: 'Published', \tdata: 'last_updated', className: 'last_updated' },\n\t\t],\n\t\tcreatedRow: function (row, data, dataIndex) {\n\t\t\t$(row).addClass('file_count' + data.no_download_item);\n\t\t},\n\t\tcolumnDefs: [\n\t\t\t{\n\t\t\t\trender: (data, type, row) => data + '' + row[\"download_url\"],\n\t\t\t\ttargets: 2\n\t\t\t},\n\t\t],\n\t\tinitComplete: function() {\n\t\t\tconst table = this.api();\n\t\t\tvar table_title = jQuery(\"#table_title\").html();\n\t\t\tvar table_description = jQuery(\"#table_description\").html();\n\t\t\tjQuery('.top_search').prepend(\"<h4>\"+table_title+\"<\/h4>\");\n\t\t\tjQuery('#table_top').append(\"<div class='top_cat_desc'>\"+table_description+\"<\/div>\");\n\t\t\taddAriaClasses(table);\n\t\t}\n\t\t});\n\t}else if(display_type == '11'){\n\t\tfunction format(d) {\n\t\t\t\/\/ `d` is the original data object for the row\n\t\t\treturn (\n\t\t\t\t'<dl>' +\n\t\t\t\t'<dt>'+d.last_updated+'<\/dt>' +\n\t\t\t\t'<dt>\u0e2d\u0e48\u0e32\u0e19  '+d.download_count+' \u0e04\u0e23\u0e31\u0e49\u0e07<\/dt>' +\n\t\t\t\t'<\/dl>'\n\t\t\t);\n\t\t}\n\t\tvar table1 = $('#dataTable').DataTable({\n\t\t\t\/\/ dom: \"t\",\n\t\t\tdom: '<\"tb-child-wrapper\"<t>>',\n\t\t\tcolumns: [\n\t\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t\t{ title: 'Read', \tdata: 'download_count', className: 'col_download' },\n\t\t\t\t{ title: 'Published',   data: 'last_updated', className: 'last_updated' },\n\t\t\t],\n\t\t\tinitComplete: function() {\n\t\t\t\tconst table = this.api();\n\t\t\t\ttable.rows().every( function ( rowIdx, tableLoop, rowLoop ) {\n\t\t\t\t\td = this.data();\n\t\t\t\t\tthis.child( format(d) ).show();\n\t\t\t\t} );\n\t\t\t\taddAriaClasses(table);\n\t\t\t}\n\t\t});\n\t\t\n\t}else if(display_type == '13'){ \/\/ Display Type 13\n\t\tvar table1 = $('#dataTable').DataTable({\n\t\t\tdom: '<\"#table_top\"<\"top_search\"f>><\"tb-main-wrapper\"<t><\"tb_bottom\"ilp>>',\n\t\t\tcolumns: [\n\t\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t\t{ title: 'Download', \tdata: 'download_file', className: 'col_file' },\n\t\t\t\t{ title: 'Published',   data: 'last_updated', className: 'last_updated' },\n\t\t\t\t{ title: 'Document Download', \tdata: 'download_count', className: 'col_download' },\n\t\t\t],\n\t\t\tcreatedRow: function (row, data, dataIndex) {\n\t\t\t\t$(row).addClass('file_count' + data.no_download_item);\n\t\t\t},\n\t\t\tcolumnDefs: [\n\t\t\t\t{\n\t\t\t\t\trender: (data, type, row) => data + '' + row[\"download_url\"],\n\t\t\t\t\ttargets: 1\n\t\t\t\t},\n\t\t\t\t{ visible: false, targets: 3 }\n\t\t\t],\t\t\t\t\n\t\t\tinitComplete: function() {\n\t\t\t\tconst table = this.api();\n\t\t\t\tvar table_title = jQuery(\"#table_title\").html();\n\t\t\t\tvar table_description = jQuery(\"#table_description\").html();\n\t\t\t\tjQuery('.top_search').prepend(\"<h4>\"+table_title+\"<\/h4>\");\n\t\t\t\tjQuery('#table_top').append(\"<div class='top_cat_desc'>\"+table_description+\"<\/div>\");\n\t\t\t\taddAriaClasses(table);\n\t\t\t}\n\t\t});\n\t}else {\n\t\t\/\/ display type 6\n\t\tvar table1 = jQuery('#dataTable').DataTable( {\n\t\t\t\tdom: '<\"#table_top\"<\"#dropdown1\"><\"#dropdown2\"><\"top_search\"f>><\"tb-main-wrapper\"<t><\"tb_bottom\"ilp>>',\n\t\t\t\tcolumns: [\n\t\t\t\t\t{ title: 'No.',     data: 'ID', className: 'col_id' },\n\t\t\t\t\t{ title: 'Title',  data: 'thumb', className: 'col_thumb' },\n\t\t\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t\t\t{ title: 'Download', \tdata: 'download_file', className: 'col_file' },\n\t\t\t\t\t{ title: 'Reference',   data: 'department',  className: 'col_department' },\n\t\t\t\t\t{ title: 'Published',   data: 'last_updated', className: 'last_updated' },\n\t\t\t\t\t{ title: 'CATEGORY',   data: 'category', className: 'col_category' },\n\t\t\t\t\t{ title: 'YEAR',   data: 'year', className: 'col_year' },\n\t\t\t\t\t{ title: 'Upload File',   data: 'download_url', className: 'col_upload' },\n\t\t\t\t],\n\t\t\t\tcreatedRow: function (row, data, dataIndex) {\n\t\t\t\t\t$(row).addClass('file_count' + data.no_download_item);\n\t\t\t\t},\n\t\t\t\tcolumnDefs: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttargets: 1,\t\n\t\t\t\t\t\tdata: 'thumb',\n\t\t\t\t\t\trender: function (data, type, row, meta) {\n\t\t\t\t\t\t\tif(data == 'x'){\n\t\t\t\t\t\t\t\treturn '<span class=\"placeholder_img\" title=\"'+row[\"name\"]+'\"><\/span>';\n\t\t\t\t\t\t\t}else if(data == ''){\n\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\treturn '<img decoding=\"async\" src=\"' + data + '\" class=\"img-fluid wp-post-image\" alt=\"'+row[\"name\"]+'\" aria-label=\"'+row[\"name\"]+'\" title=\"'+row[\"name\"]+'\"role=\"presentation\">';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttargets: 3,\n\t\t\t\t\t\trender: function (data, type, row, meta) {\n\t\t\t\t\t\t\treturn (data == '') ? '' : data + '' + row[\"download_url\"];\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\t\n\t\t\t\tinitComplete: function() {\n\t\t\t\t\tconst table = this.api();\n\t\t\t\t\tvar table_title = jQuery(\"#table_title\").html();\n\t\t\t\t\tjQuery('#dataTable_wrapper').prepend(\"<h4>\"+table_title+\"<\/h4>\");\n\t\t\t\t}\n\n\t\t\t});\n\t\t\ttable1.on( 'init.dt', function() {\n\t\t\t\t\/\/show nothing\n\t\t\t\tconsole.log('access to: ', $('.dataTables_scroll') );\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\/\/show element\n\t\t\t\t\tbuildTable2Search(table1);\n\t\t\t\t}, 100);\n\t\t\t\tbuildSelect(table1);\n\t\t\t});\n\t\t\tvar table2 = jQuery('#dataTable2').DataTable( {\n\t\t\t\tdom: '<\"#table_top\"<\"top_search\"f>><\"tb-main-wrapper\"<t><\"tb_bottom\"ilp>>',\n\n\t\t\t\t\/\/pageLength: 2,\n\n\t\t\t\tcolumns: [\n\t\t\t\t\t{ title: 'No.',     data: 'ID', className: 'col_id' },\n\t\t\t\t\t{ title: 'Title',  data: 'thumb', className: 'col_thumb' },\n\t\t\t\t\t{ title: 'Title',  data: 'name', className: 'col_title' },\n\t\t\t\t\t{ title: 'Download', \tdata: 'download_file', className: 'col_file' },\n\t\t\t\t\t{ title: 'Reference',   data: 'department',  className: 'col_department' },\n\t\t\t\t\t{ title: 'Published',   data: 'last_updated', className: 'last_updated' },\n\t\t\t\t\t{ title: 'Upload File',   data: 'download_url', className: 'col_upload' },\n\t\t\t\t\t{ title: 'CATEGORY',   data: 'category', className: 'col_category' },\n\t\t\t\t\t{ title: 'YEAR',   data: 'year', className: 'col_year' },\t\t\t\t\t\n\t\t\t\t],\n\t\t\t\tcreatedRow: function (row, data, dataIndex) {\n\t\t\t\t\t$(row).addClass('file_count' + data.no_download_item);\n\t\t\t\t},\n\t\t\t\tcolumnDefs: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttargets: 1,\t\n\t\t\t\t\t\tdata: 'thumb',\n\t\t\t\t\t\trender: function (data, type, row, meta) {\n\t\t\t\t\t\t\tif(data == 'x'){\n\t\t\t\t\t\t\t\treturn '<span class=\"placeholder_img\" title=\"'+row[\"name\"]+'\"><\/span>';\n\t\t\t\t\t\t\t}else if(data == ''){\n\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\treturn '<img decoding=\"async\" src=\"' + data + '\" class=\"img-fluid wp-post-image\" alt=\"'+row[\"name\"]+'\" aria-label=\"'+row[\"name\"]+'\" title=\"'+row[\"name\"]+'\"role=\"presentation\">';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t},\t\n\t\t\t\t\t{\n\t\t\t\t\t\trender: (data, type, row) => data + '' + row[\"download_url\"],\n\t\t\t\t\t\ttargets: 3\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinitComplete: function() {\n\t\t\t\t\tconst table3 = this.api();\n\t\t\t\t\tjQuery('#dataTable2_wrapper .top_search').prepend(\"<h4>\"+\"\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14  (Latest Data)\"+\"<\/h4>\");\n\t\t\t\t\t\/\/new table3.search(max).draw();\n\t\t\t\t\t\n\t\t\t\t},\n\n\t\t\t});\n\n\t\t\t\/*var max = table1\n\t\t\t.column( 9 )\n\t\t\t.data()\n\t\t\t.reduce( function (a,b) {\n\t\t\t\treturn Math.max(a,b);\n\t\t\t} );*\/\n\t\t\t\n\t}\n\tvar selCol = display_type;\n\t\/\/console.log(display_type);\n\tif(selCol == '6'){\n\t\ttable1.columns( [6,7,8] ).visible( false);\n\t\ttable2.columns( [6,7,8] ).visible( false);\n\t}\n\telse if(selCol == '1'){\n\t\ttable1.columns( [0,1,5,6,7,8] ).visible( false);\n\t}\n\telse if(selCol == '2'){\n\t\ttable1.columns( [5,6,7,8] ).visible( false);\n\t}\n\telse if(selCol == '3' || selCol == '5'){\n\t\ttable1.columns( [5,6,7,8] ).visible( false);\n\t}\n\telse if(selCol == '4'){\n\t\ttable1.columns( [5,6] ).visible( false);\n\t}\n\telse if(selCol == '12'){\n\t\ttable1.columns( [6,7,8] ).visible( false);\n\t}\n\telse if(selCol == '13'){\n\t\ttable1.columns( [3] ).visible( false);\n\t}\n\n\tfunction buildSelect(table) {\n\t\tvar counter = 0;\n\t\ttable.columns([6,7]).every(function() {\n\t\t\tvar column = table.column(this, {\n\t\t\t  search: 'applied'\n\t\t\t});\n\t\t\tcounter++;\n\t\t\tvar select = $('<select class=\"form-select js-select2\"><option value=\"\">'+column.title()+'<\/option><\/select>')\n\t\t\t  .appendTo($('#dropdown' + counter).empty())\n\t\t\t  .on('change', function() {\n\t\t\t\tvar val = $.fn.dataTable.util.escapeRegex(\n\t\t\t\t  $(this).val()\n\t\t\t\t);\n\t\t\t\tcolumn\n\t\t\t\t  .search(val ? '^' + val + '$' : '', true, false)\n\t\t\t\t  .draw();\n\t\t\t  });\n\n\t\t\tcolumn.data().unique().sort().each(function(d, j) {\n\t\t\t\tif(d != ''){\n\t\t\t\t\tselect.append('<option value=\"' + d + '\">' + d + '<\/option>');\n\t\t\t\t}else{\n\t\t\t\t\tselect.hide();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t\/\/ The rebuild will clear the exisiting select, so it needs to be repopulated\n\t\t\tvar currSearch = column.search();\n\t\t\tif (currSearch) {\n\t\t\t  \/\/ ** MY CHANGE **\n\t\t\t  \/\/ Use RegEx to find the selected value from the unique values of the column.\n\t\t\t  \/\/ This will use the Regular Expression returned from column.search to find the first matching item in column.data().unique\n\t\t\t  select.val(column.data().unique().toArray().find((e) => e.match(new RegExp(currSearch))));\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction buildTab(table) {\n\t\tvar counter = 0;\n\t\ttable.columns([7]).every(function() {\n\t\t\tvar column = table.column(this, {\n\t\t\t  search: 'applied'\n\t\t\t});\n\t\t\tcounter++;\n\t\t\tvar tab = $('<ul class=\"nav\"><\/ul>')\n\t\t\t.appendTo($('#dropdown' + counter).empty())\n\t\t\t.on('click','li button', function() {\n\t\t\t\t$(\"#dropdown1 li\").removeClass('active');\n\t\t\t\tvar val = $(this).data(\"tab\");\n\t\t\t\tcolumn\n\t\t\t\t  .search(val ? '^' + val + '$' : '', true, false)\n\t\t\t\t  .draw();\n\t\t\t\t $(this).parent('li').addClass('active');\n\t\t\t});\n\t\t\tcolumn.data().unique().sort().each(function(d, j) {\n\t\t\t\tif(d != ''){\n\t\t\t\t\ttab.append('<li class=\"nav-item\" role=\"presentation\"><button class=\"nav-link\" aria-current=\"page\" data-tab=\"'+ d +'\" href=\"#\">?? '+ d +'<\/button><\/li>');\n\t\t\t\t}\n\t\t\t});\n\t\t\t\/\/ The rebuild will clear the exisiting tab, so it needs to be repopulated\n\t\t\tvar currSearch = column.search();\n\t\t\tif (currSearch) {\n\t\t\t  \/\/ ** MY CHANGE **\n\t\t\t  \/\/ Use RegEx to find the selected value from the unique values of the column.\n\t\t\t  \/\/ This will use the Regular Expression returned from column.search to find the first matching item in column.data().unique\n\t\t\t  tab.val(column.data().unique().toArray().find((e) => e.match(new RegExp(currSearch))));\n\t\t\t}\n\t\t});\n\t}\n\t\n\tfunction buildTabCat(table) {\n\t\tvar counter = 0;\n\t\ttable.columns([6]).every(function() {\n\t\t\tvar column = table.column(this, {\n\t\t\t  search: 'applied'\n\t\t\t});\n\t\t\tcounter++;\n\t\t\tvar tab = $('<ul class=\"nav\"><\/ul>')\n\t\t\t.appendTo($('#dropdown' + counter).empty())\n\t\t\t.on('click','li button', function() {\n\t\t\t\t$(\"#dropdown1 li\").removeClass('active');\n\t\t\t\tvar val = $(this).data(\"tab\");\n\t\t\t\tcolumn\n\t\t\t\t  .search(val ? '^' + val + '$' : '', true, false)\n\t\t\t\t  .draw();\n\t\t\t\t $(this).parent('li').addClass('active');\n\t\t\t});\n\t\t\tcolumn.data().unique().sort().each(function(d, j) {\n\t\t\t\tif(d != ''){\n\t\t\t\t\ttab.append('<li class=\"nav-item\" role=\"presentation\"><button class=\"nav-link\" aria-current=\"page\" data-tab=\"'+ d +'\" href=\"#\">'+ d +'<\/button><\/li>');\n\t\t\t\t}\n\t\t\t});\n\t\t\t\/\/ The rebuild will clear the exisiting tab, so it needs to be repopulated\n\t\t\tvar currSearch = column.search();\n\t\t\tif (currSearch) {\n\t\t\t  \/\/ ** MY CHANGE **\n\t\t\t  \/\/ Use RegEx to find the selected value from the unique values of the column.\n\t\t\t  \/\/ This will use the Regular Expression returned from column.search to find the first matching item in column.data().unique\n\t\t\t  tab.val(column.data().unique().toArray().find((e) => e.match(new RegExp(currSearch))));\n\t\t\t}\n\t\t});\n\t}\n\tfunction buildTable2Search(table) {\n\t\tvar max = 0;\n\t\tmax = table.column('.last_updated').data().sort().reverse()[0];\n\t\tif(max != 0){\n\t\t\tnew DataTable.Api('#dataTable2').search(max).draw();\n\t\t}\n\t}\n\tfunction addAriaClasses(table){\n\t\t$('.dt-column-order').each(function () {\n\t\t  $(this).attr(\"aria-label\", \"Click to sort column\");\n\t\t  $(this).attr(\"title\", \"Activate to sort column\");\n\t\t  $(this).attr(\"role\", \"Button\");\n\t\t});\n\t\t$(table).find('.dt-info').attr(\"aria-label\", \"Current page view info\");\n\t\t$('#dt-length-0').attr(\"aria-label\", \"Select rows per page\");\n\t}\n});\n<\/script><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_5753\" class=\"pvc_stats total_only  \" data-element-id=\"5753\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/www.nesdc.go.th\/wordpress\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":4,"featured_media":3203,"parent":5737,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"pageStatistic.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-5753","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/pages\/5753"}],"collection":[{"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/comments?post=5753"}],"version-history":[{"count":0,"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/pages\/5753\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/pages\/5737"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/media\/3203"}],"wp:attachment":[{"href":"https:\/\/www.nesdc.go.th\/en\/wp-json\/wp\/v2\/media?parent=5753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}