{"id":4616,"date":"2018-11-30T03:10:46","date_gmt":"2018-11-30T03:10:46","guid":{"rendered":"https:\/\/www.codebee.co.th\/labs\/?p=4616"},"modified":"2018-11-30T03:37:23","modified_gmt":"2018-11-30T03:37:23","slug":"datatables-js-%e0%b9%83%e0%b8%8a%e0%b9%89-ajax-%e0%b9%82%e0%b8%ab%e0%b8%a5%e0%b8%94%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b8%97%e0%b8%b5%e0%b8%a5%e0%b8%b0%e0%b8%ab%e0%b8%99%e0%b9%89","status":"publish","type":"post","link":"https:\/\/www.codebee.co.th\/labs\/datatables-js-%e0%b9%83%e0%b8%8a%e0%b9%89-ajax-%e0%b9%82%e0%b8%ab%e0%b8%a5%e0%b8%94%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5%e0%b8%97%e0%b8%b5%e0%b8%a5%e0%b8%b0%e0%b8%ab%e0%b8%99%e0%b9%89\/","title":{"rendered":"Datatables.js \u0e43\u0e0a\u0e49 Ajax \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e25\u0e30\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e01\u0e34\u0e19 10,000 Row"},"content":{"rendered":"<h2>Datatables.js \u0e43\u0e0a\u0e49 Ajax \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e25\u0e30\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e01\u0e34\u0e19 10,000 Row<\/h2>\n<p><strong>Datatables.js \u0e43\u0e0a\u0e49 Ajax \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e25\u0e30\u0e2b\u0e19\u0e49\u0e32<\/strong><\/p>\n<p>\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e32\u0e23\u0e32\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e2d\u0e35\u0e01\u0e2b\u0e19\u0e36\u0e48\u0e07 plugin \u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e19\u0e34\u0e22\u0e21\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e21\u0e32\u0e01\u0e04\u0e37\u0e2d datatables.js \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e22\u0e37\u0e14\u0e2b\u0e22\u0e38\u0e48\u0e19\u0e2a\u0e39\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1b\u0e23\u0e31\u0e1a\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e32\u0e23\u0e32\u0e07\u0e44\u0e14\u0e49\u0e2b\u0e25\u0e32\u0e01\u0e2b\u0e25\u0e32\u0e22 \u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a responsive table \u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e07\u0e48\u0e32\u0e22 \u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e32\u0e23\u0e32\u0e07\u0e41\u0e25\u0e30\u0e17\u0e33\u0e23\u0e32\u0e22\u0e07\u0e32\u0e19<!--more--><\/p>\n<p>\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01 query \u0e21\u0e32\u0e08\u0e32\u0e01\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1b\u0e23\u0e34\u0e21\u0e32\u0e13\u0e21\u0e32\u0e01 \u0e46 datatables.js \u0e44\u0e14\u0e49\u0e16\u0e39\u0e01\u0e2d\u0e2d\u0e01\u0e41\u0e1a\u0e1a\u0e21\u0e32\u0e43\u0e2b\u0e49\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a \u0e40\u0e1e\u0e35\u0e22\u0e07\u0e41\u0e15\u0e48\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e08\u0e30\u0e15\u0e49\u0e2d\u0e07 \u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e17\u0e35\u0e48\u0e16\u0e39\u0e01\u0e15\u0e49\u0e2d\u0e07\u0e17\u0e31\u0e49\u0e07\u0e2a\u0e48\u0e27\u0e19\u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23 query \u0e08\u0e31\u0e14\u0e01\u0e32\u0e23 format \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 \u0e08\u0e19\u0e16\u0e36\u0e07\u0e2a\u0e48\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2d\u0e2d\u0e01\u0e21\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25<\/p>\n<p><strong>\u0e1c\u0e25\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a<\/strong><br \/>\n\u0e08\u0e32\u0e01\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e42\u0e14\u0e22\u0e44\u0e14\u0e49\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e19\u0e32\u0e14 70,000&#215;6 Row Column \u0e04\u0e27\u0e32\u0e21\u0e2b\u0e21\u0e32\u0e22\u0e04\u0e37\u0e2d \u0e21\u0e35 field \u0e43\u0e19\u0e40\u0e17\u0e40\u0e1a\u0e34\u0e49\u0e25\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 6 Column \u0e41\u0e25\u0e30\u0e21\u0e35\u0e01\u0e32\u0e23 insert \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 70,000 Row \u0e41\u0e19\u0e48\u0e19\u0e2d\u0e19\u0e27\u0e48\u0e32\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e43\u0e0a\u0e49\u0e01\u0e32\u0e23 query \u0e21\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e43\u0e19 datatable \u0e2b\u0e25\u0e31\u0e01 10,000 Row \u0e23\u0e30\u0e1a\u0e1a\u0e01\u0e47\u0e04\u0e07\u0e17\u0e33\u0e07\u0e32\u0e19\u0e44\u0e21\u0e48\u0e44\u0e2b\u0e27\u0e41\u0e25\u0e49\u0e27 <\/p>\n<blockquote><p><a href=\"https:\/\/codebee.co.th\/labs\/examples\/exam3\/datatables\/\" rel=\"noopener\" target=\"_blank\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07 Datatables.js \u0e43\u0e0a\u0e49 Ajax \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e25\u0e30\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e01\u0e34\u0e19 10,000 Row<\/a><\/p><\/blockquote>\n<p><strong>\u0e27\u0e34\u0e18\u0e35\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/strong><\/p>\n<ul>\n<li>\u0e2a\u0e23\u0e49\u0e32\u0e07 html \u0e01\u0e33\u0e2b\u0e19\u0e14 ID \u0e43\u0e2b\u0e49 table \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e43\u0e0a\u0e49\u0e01\u0e31\u0e1a datatables plugin\n<pre class=\"lang:default decode:true \" >&lt;table id=\"authors_table\"&gt; &lt;!--\u0e01\u0e33\u0e2b\u0e19\u0e14 ID \u0e43\u0e2b\u0e49 table \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e43\u0e0a\u0e49\u0e01\u0e31\u0e1a datatables plugin--&gt;\r\n    &lt;thead&gt;\r\n        &lt;tr&gt;\r\n            &lt;th&gt;ID&lt;\/th&gt;\r\n            &lt;th&gt;First Name&lt;\/th&gt;\r\n            &lt;th&gt;Last Name&lt;\/th&gt;\r\n            &lt;th&gt;Email&lt;\/th&gt;\r\n            &lt;th&gt;Birthdate&lt;\/th&gt;\r\n            &lt;th&gt;Added&lt;\/th&gt;\r\n        &lt;\/tr&gt;\r\n    &lt;\/thead&gt;\r\n    &lt;tbody&gt;\r\n        \r\n        &lt;!--\u0e42\u0e2b\u0e25\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 Row x Column \u0e40\u0e02\u0e49\u0e32\u0e21\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25--&gt;\r\n        \r\n    &lt;\/tbody&gt;\r\n&lt;\/table&gt;<\/pre>\n<\/li>\n<li>\u0e40\u0e02\u0e35\u0e22\u0e19 javascript \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 JSON \u0e08\u0e32\u0e01 PHP \u0e21\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e19 Datatables\n<pre class=\"lang:default decode:true \" >var authors_table = $(\"#authors_table\").DataTable({\r\n    \"sPaginationType\": \"full_numbers\",\r\n    \"pageLength\": 25\r\n    \"columns\": [\r\n            {\"width\": \"10%\" },\r\n            {\"width\": \"20%\" },\r\n            {\"width\": \"20%\" },\r\n            {\"width\": \"10%\" },\r\n            {\"width\": \"10%\" },\r\n            {\"width\": \"15%\" }\r\n     ],\r\n    \"processing\": true,\r\n    \"serverSide\": true,\r\n    \"ajax\": \"getAuthors.php\"\r\n});<\/pre>\n<\/li>\n<li><a href=\"https:\/\/github.com\/DataTables\/DataTables\/blob\/master\/examples\/server_side\/scripts\/ssp.class.php\" rel=\"noopener\" target=\"_blank\">\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14 ssp.class.php<\/a> \u0e0b\u0e36\u0e48\u0e07\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e42\u0e14\u0e22\u0e17\u0e35\u0e21\u0e1e\u0e31\u0e12\u0e19\u0e32 datatables.js \u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e40\u0e02\u0e35\u0e22\u0e19 PHP \u0e40\u0e1e\u0e37\u0e48\u0e2d Query \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e14\u0e31\u0e07\u0e19\u0e35\u0e49\n<pre class=\"lang:default decode:true \" >require 'ssp.class.php';\r\n$table = 'authors';\r\n$primaryKey = 'id';\r\n$columns = array(\r\n\tarray( 'db' =&gt; 'id', 'dt' =&gt; 0 ),\r\n\tarray( 'db' =&gt; 'first_name',  'dt' =&gt; 1 ),\r\n\tarray( 'db' =&gt; 'last_name',   'dt' =&gt; 2 ),\r\n\tarray( 'db' =&gt; 'email',     'dt' =&gt; 3 ),\r\n\tarray( 'db' =&gt; 'birthdate','dt' =&gt; 4 ),\r\n\tarray( 'db' =&gt; 'added','dt' =&gt; 5)\r\n);\r\n\r\n$sql_details = array(\r\n\t'user' =&gt; 'xxxx',\r\n\t'pass' =&gt; 'xxxx',\r\n\t'db'   =&gt; 'xxxx',\r\n\t'host' =&gt; 'localhost'\r\n);\r\n\r\necho json_encode(\r\n\t$authors = SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns )\r\n);<\/pre>\n<\/li>\n<\/ul>\n<p><\/br><\/p>\n<p>\u0e19\u0e31\u0e01\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e17\u0e48\u0e32\u0e19\u0e43\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21 \u0e2d\u0e32\u0e08\u0e08\u0e30\u0e25\u0e2d\u0e07\u0e40\u0e1e\u0e34\u0e48\u0e21 row \u0e41\u0e25\u0e30 column \u0e2b\u0e23\u0e37\u0e2d\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e01\u0e32\u0e23 join \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e32\u0e01 1 \u0e15\u0e32\u0e23\u0e32\u0e07 \u0e40\u0e1b\u0e47\u0e19 2 3 \u0e15\u0e32\u0e23\u0e32\u0e07\u0e14\u0e39\u0e04\u0e23\u0e31\u0e1a \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e08\u0e23\u0e34\u0e07 \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e2d\u0e32\u0e08\u0e08\u0e30\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e21\u0e32\u0e08\u0e32\u0e01\u0e15\u0e32\u0e23\u0e32\u0e07\u0e40\u0e14\u0e35\u0e22\u0e27<br \/>\n<\/br>\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e17\u0e33 database generate \u0e44\u0e14\u0e49\u0e17\u0e35\u0e48\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c filldb.info \u0e44\u0e14\u0e49\u0e40\u0e25\u0e22\u0e04\u0e23\u0e31\u0e1a<br \/>\n<\/br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Datatables.js \u0e43\u0e0a\u0e49 Ajax \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e25\u0e30\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e01\u0e34\u0e19 10,000 Row Datatables.js \u0e43\u0e0a\u0e49 Ajax \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e25\u0e30\u0e2b\u0e19\u0e49\u0e32 \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e32\u0e23\u0e32\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e2d\u0e35\u0e01\u0e2b\u0e19\u0e36\u0e48\u0e07 plugin \u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e19\u0e34\u0e22\u0e21\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e21\u0e32\u0e01\u0e04\u0e37\u0e2d datatables.js \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e22\u0e37\u0e14\u0e2b\u0e22\u0e38\u0e48\u0e19\u0e2a\u0e39\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e1b\u0e23\u0e31\u0e1a\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a\u0e15\u0e32\u0e23\u0e32\u0e07\u0e44\u0e14\u0e49\u0e2b\u0e25\u0e32\u0e01\u0e2b\u0e25\u0e32\u0e22 \u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a responsive table \u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e07\u0e48\u0e32\u0e22&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4626,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"video","meta":{"footnotes":""},"categories":[46],"tags":[1896,1897,1895,1894],"class_list":["post-4616","post","type-post","status-publish","format-video","has-post-thumbnail","hentry","category-website-development-","tag-ajax","tag-database-query","tag-datatables-js","tag-datatables-js--ajax","post_format-post-format-video"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/4616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/comments?post=4616"}],"version-history":[{"count":13,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/4616\/revisions"}],"predecessor-version":[{"id":4635,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/posts\/4616\/revisions\/4635"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/media\/4626"}],"wp:attachment":[{"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/media?parent=4616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/categories?post=4616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codebee.co.th\/labs\/wp-json\/wp\/v2\/tags?post=4616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}