{"id":4199,"date":"2019-02-14T14:42:42","date_gmt":"2019-02-14T21:42:42","guid":{"rendered":"http:\/\/behstant.com\/blog\/?p=4199"},"modified":"2019-02-14T14:46:50","modified_gmt":"2019-02-14T21:46:50","slug":"jquery-datatables-sdom","status":"publish","type":"post","link":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/","title":{"rendered":"jQuery Datatables sDom &#8211; Custom Elements"},"content":{"rendered":"<p>This post is the next part of Working with the jQuery Datatables plugin. Since this tutorial is written for those familiar with the plugin You might need to learn the basics of the plugin on the following link <a href=\"http:\/\/behstant.com\/blog\/jquery\/datatables-jquery-implementation\/\">http:\/\/behstant.com\/blog\/jquery\/datatables-jquery-implementation\/<\/a>. On this tutorial I am going to focus on how to manipulate the elements of the Datatables by using the sDom property. In the first place you need to know that the plugin jQuery Datatables have 4 visual core elements:<\/p>\n<ol>\n<li>Number of items to Display.<\/li>\n<li>The main table.<\/li>\n<li>Number of records retrieved.<\/li>\n<li>Paginator.<\/li>\n<\/ol>\n<p>Since these elements are visual you can put them in different positions or perhaps you can decide to set them visible or not, however, remember that not adding information into this property will result in a working DataTable using the default settings.<\/p>\n<p><!--more--><\/p>\n<h2>jQuery Datatables sDom meaning<\/h2>\n<table class=\"information-table\">\n<thead>\n<tr>\n<th>Shortcut<\/th>\n<th>Image (below) Reference<\/th>\n<th>Quick Reference<\/th>\n<th>Comments<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>l<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>Lenght Changing<\/td>\n<td>This controls the number of records to display in the table.<\/td>\n<\/tr>\n<tr>\n<td>f<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<td>Filtering input<\/td>\n<td>The search box where you can filter or search data in the table.<\/td>\n<\/tr>\n<tr>\n<td>t<\/td>\n<td style=\"text-align: center;\">3<\/td>\n<td>The Table<\/td>\n<td>This is the table where all the information is display.<\/td>\n<\/tr>\n<tr>\n<td>i<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>Information<\/td>\n<td>This display the number of records inside the jQuery Datatables.<\/td>\n<\/tr>\n<tr>\n<td>p<\/td>\n<td style=\"text-align: center;\">5<\/td>\n<td>Pagination<\/td>\n<td>Display a pagination section if there many records.<\/td>\n<\/tr>\n<tr>\n<td>r<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td>pRocessing<\/td>\n<td>The &#8220;Processing&#8221; text that pops up when the data is being loaded. This is<br \/>\ndisplay when there are many records to be loaded.<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #87c081; color: #fff; text-shadow: 2px 0px 2px rgba(150, 150, 150, 1);\" colspan=\"4\">The Following constants were allowed<\/td>\n<\/tr>\n<tr>\n<td>H<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td>jQueryUI theme &#8220;header&#8221; classes (&#8216;fg-toolbar ui-widget-header ui-corner-tl<br \/>\nui-corner-tr ui-helper-clearfix&#8217;)<\/td>\n<td rowspan=\"2\">This constants were allow in former versions, now they are<br \/>\ndeprecaded. You can take a look at the source code where the H constant is<br \/>\nreplace, it is replace by a value defined <a href=\"https:\/\/gist.github.com\/Reedyseth\/820f0384e9cc582b06810c0dee226cdd#file-datatables-deprecated-js-L60\" target=\"_blank\" rel=\"noopener\">here<\/a> and assigned <a href=\"https:\/\/gist.github.com\/Reedyseth\/bf083f953151d2cec5632f00de643ae4\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td>F<\/td>\n<td style=\"text-align: center;\">&#8211;<\/td>\n<td>jQueryUI theme &#8220;footer&#8221; classes (&#8216;fg-toolbar ui-widget-header ui-corner-bl<br \/>\nui-corner-br ui-helper-clearfix&#8217;)<\/td>\n<\/tr>\n<tr>\n<td style=\"background-color: #87c081; color: #fff; text-shadow: 2px 0px 2px rgba(150, 150, 150, 1);\" colspan=\"4\">The Following syntax is expected:<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">&#8216;&lt;&#8216; and &#8216;&gt;&#8217; &#8211; div elements<\/td>\n<td rowspan=\"3\">I will explain this below.<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">&#8216;&lt;&#8220;class&#8221; and &#8216;&gt;&#8217; &#8211; div with a class<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">&#8216;&lt;&#8220;#id&#8221; and &#8216;&gt;&#8217; &#8211; div with an ID<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<figure id=\"attachment_6066\" aria-describedby=\"caption-attachment-6066\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/05\/datatables-elements.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-6066\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/05\/datatables-elements.png\" alt=\"Datatable sDom Elements\" width=\"585\" height=\"471\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/05\/datatables-elements.png 885w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/05\/datatables-elements-300x241.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/05\/datatables-elements-768x618.png 768w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><figcaption id=\"caption-attachment-6066\" class=\"wp-caption-text\">Datatable sDom Elements<\/figcaption><\/figure>\n<h2>Database Setup<\/h2>\n<p>Before we can make something with the jQuery Datatable plugin we need information to load so in order to do that please create a table with the name employee in your tutorials database ( if you don&#8217;t have this database don&#8217;t worry, you can get it&nbsp;by <a href=\"#download-code\">downloading<\/a> the code ).<\/p>\n<p><a href=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/06\/phpmyadmin_create_table_employee-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-6501\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/06\/phpmyadmin_create_table_employee-1-300x119.png\" alt=\"Creation of Employee Table\" width=\"406\" height=\"161\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/06\/phpmyadmin_create_table_employee-1-300x119.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/06\/phpmyadmin_create_table_employee-1-768x305.png 768w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/06\/phpmyadmin_create_table_employee-1-1024x407.png 1024w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/06\/phpmyadmin_create_table_employee-1.png 1214w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/p>\n<p>After you create the table is time to fill it. You can take three roads from here:<\/p>\n<p>1)You can add information using phpMyAdmin for every record.<\/p>\n<p><a href=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/11\/phpMyAdmin-data-insert.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7079\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/11\/phpMyAdmin-data-insert-300x102.png\" alt=\"phpMyAdmin Data Insert\" width=\"397\" height=\"135\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/11\/phpMyAdmin-data-insert-300x102.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/11\/phpMyAdmin-data-insert-768x261.png 768w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/11\/phpMyAdmin-data-insert.png 971w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><\/a><\/p>\n<p>2) You can insert a record manually with random information.<\/p>\n<pre class=\"lang:mysql decode:true \">--\nINSERT INTO employee(name,email,telephone) VALUES(&#039;Pancho Villa&#039;,&#039;pvilla@revolution.com&#039;,&#039;123-654-7789&#039;);\n--\n<\/pre>\n<p>3) Use the insert script located&nbsp;in the download files with hundred of records.<\/p>\n<p>After you load the information on the database it is time to start working on the code \ud83d\ude42<\/p>\n<h2>Table Structure<\/h2>\n<p>This is the structure of the table where the results will be loaded:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;table id=&quot;resultTable&quot; class=&quot;resultTable&quot;&gt;\n    &lt;thead&gt;\n        &lt;tr&gt;\n            &lt;th&gt;Employee ID&lt;\/th&gt;\n            &lt;th&gt;Name&lt;\/th&gt;\n            &lt;th&gt;Email&lt;\/th&gt;\n            &lt;th&gt;Telephone&lt;\/th&gt;\n        &lt;\/tr&gt;\n    &lt;\/thead&gt;\n    &lt;tbody&gt;&lt;\/tbody&gt;\n&lt;\/table&gt;<\/pre>\n<p>Let me explain a bit about what is going to happen. We are going to make an Ajax request using jQuery in order to get all the records on the employee&nbsp;table that we previously populated, the backend code is not relevant on this tutorial since I am focusing on the jQuery code, nevertheless you can get the PHP backend code in the download files or the video.<\/p>\n<h2>Managing the data<\/h2>\n<p>We are going to place the retrieved&nbsp;data into the <span style=\"font-family: 'courier new', courier, monospace;\">tbody<\/span> tag of the table using jQuery like the following example:<\/p>\n<pre class=\"lang:js decode:true\">\/\/\n\n$(&#039;#resultTable tbody&#039;).html( tbody );\n\n\/\/<\/pre>\n<p>With the data loaded in the HTML table we are ready to use the jQuery Datatables Plugin like this:<\/p>\n<pre class=\"lang:js decode:true\">\/\/\n$(&#039;#resultTable&#039;).DataTable({ sDom: &#039;&lt;&quot;top&quot;lf&gt;r&lt;&quot;H&quot;t&gt;&lt;&quot;bottom&quot;i&gt;&lt;&quot;floatRight&quot;p&gt;&#039;});\n\/\/<\/pre>\n<p>On the tutorial <a href=\"http:\/\/behstant.com\/blog\/jquery\/datatables-jquery-implementation\/\" target=\"_blank\" rel=\"noopener\">jQuey Datatable Implementation<\/a>&nbsp;I showed you how to load this libraries. Now is time to load the retrieve information withe Our core code:<\/p>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\n\t$.ajax({\n\t\turl: &quot;php\/retrieveEmployees.php&quot;,\n\t\tdataType: &quot;json&quot;,\n\t\tsuccess: function( response ){\n\t\t\tvar tbody = &quot;&quot;;\n\t\t\tfor (var i = 0; i &lt; response.length - 1; i++) {\n\t\t\t    tbody += &quot;&lt;tr&gt;&quot; +\n\t\t\t\t     &quot;&lt;td&gt;&lt;a href=&#039;#&#039;&gt;&quot;+ response[i].employee_id +&quot;&lt;\/a&gt;&lt;\/td&gt;&quot;+\n\t\t\t\t     &quot;&lt;td&gt;&quot;+ response[i].name +&quot;&lt;\/td&gt;&quot;+\n\t\t\t\t     &quot;&lt;td&gt;&quot;+ response[i].email +&quot;&lt;\/td&gt;&quot;+\n\t\t\t\t     &quot;&lt;td&gt;&quot;+ response[i].telephone +&quot;&lt;\/td&gt;&quot;+\n\t\t\t\t  &quot;&lt;\/tr&gt;&quot;;\n\t\t\t}\n\t\t\t$(&#039;#resultTable tbody&#039;).html( tbody );\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\t\/\/ Just for debuggin purposes\n\t\t}\n\t});\n});<\/pre>\n<p>In the previous code I have created the table row elements for each record retrieve. The response by the server is a JSON where we can access the employee fields by their name (the reason of this is that on the backend I kept the database column names). This a portion of the JSON retrieved:<\/p>\n<p>JSON CODE EXAMPLE<\/p>\n<p>If you are concern about data validation then you can make sure that the response variable is an Object and also that is has information, I explain in more detail on the <a href=\"#\">video<\/a>.<\/p>\n<h2>Usage of sDom Property<\/h2>\n<p>As &nbsp;I show you on the table the meaning of the letters used on the sDom attribute we are creating \/ instantiating the jQuery Datatables by placing the length&nbsp;of records on the top by using the &#8220;top&#8221; class along with the filtering input, this will be our result:<\/p>\n<p><a href=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/datatables-lenght-filter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7215\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/datatables-lenght-filter-300x91.png\" alt=\"Datatables Lenght Filter placemente\" width=\"422\" height=\"128\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/datatables-lenght-filter-300x91.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/datatables-lenght-filter-768x232.png 768w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/datatables-lenght-filter-1024x310.png 1024w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/datatables-lenght-filter.png 1171w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/a><\/p>\n<p>So far we get the default template because we did not defined the attributes for the &#8220;top&#8221; class, so the result would had been the same as write:<\/p>\n<pre class=\"lang:js decode:true \">\/\/\n$(&#039;#resultTable&#039;).DataTable({ sDom: &#039;lfr&lt;&quot;H&quot;t&gt;&lt;&quot;bottom&quot;i&gt;&lt;&quot;floatRight&quot;p&gt;&#039;});\n\/\/<\/pre>\n<p>Notice that we remove the &#8220;less than&#8221; and &#8220;greater than&#8221; chars, this is because the only purpose to use them is to add a class inside of if. You might ask, how does this work? Well, by wrapping the tokens inside &nbsp;the &#8220;less than&#8221; and &#8220;greater than&#8221; chars we are telling the plugin to wrap all inside a div element, therefore if you inspect the code you will find out this:<\/p>\n<p><a href=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Placement.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7217\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Placement-300x213.png\" alt=\"Datatable Div Placement\" width=\"454\" height=\"322\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Placement-300x213.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Placement-768x546.png 768w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Placement-1024x729.png 1024w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Placement.png 1279w\" sizes=\"auto, (max-width: 454px) 100vw, 454px\" \/><\/a><\/p>\n<p>By adding the &#8220;top&#8221; class you will find the div containing the &#8220;top&#8221; class that I mentioned.<\/p>\n<p><a href=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7219\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-300x203.png\" alt=\"Datatable Div Class Placement\" width=\"453\" height=\"306\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-300x203.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-768x520.png 768w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-1024x694.png 1024w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement.png 1280w\" sizes=\"auto, (max-width: 453px) 100vw, 453px\" \/><\/a><\/p>\n<h2>CONCLUSION<\/h2>\n<p>In conclusion, As you can see placing the correct elements in the property sDOM will allow you to work with classes and the tokens. The sDOM property will help you to position the jQuery Datatables elements in different positions. This property is very useful in when you don&#8217;t want the position of the jQuery Datatables in the default&nbsp;settings. Perhaps you want to apply a custom CSS to the Datatables controls. You can use this to move the Search input into the left and the Paginator ( by default is on the right&nbsp;) see the example:<\/p>\n<p><a href=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7220\" src=\"https:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-2-300x203.png\" alt=\"Datatable Div Class Placement 2\" width=\"453\" height=\"307\" srcset=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-2-300x203.png 300w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-2-768x519.png 768w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-2-1024x692.png 1024w, http:\/\/behstant.com\/blog\/wp-content\/uploads\/2016\/12\/Datatable-Div-Class-Placement-2.png 1280w\" sizes=\"auto, (max-width: 453px) 100vw, 453px\" \/><\/a><\/p>\n<p><span id=\"download-code\">The jQuery DataTables sDOM property will allow you to customize the layout to fit your design needs.<\/span><\/p>\n<p>Leave a reply if you found this helpful or let me know what do you think about this plugin.<\/p>\n<h1>DOWNLOAD THE FULL CODE<\/h1>\n<p>I encourage to purchase the code, as a result, you will get this with the purchase:<\/p>\n<ul>\n<li>Application style displayed on the images.<\/li>\n<li>Bootstrap HTML code for the examples.<\/li>\n<li>Server side code to retrieve the information in JSON format.<\/li>\n<li>Database file to avoid the manual insertions of records.<\/li>\n<li>Full code commented. PRO<\/li>\n<li>Responsive code. PRO<\/li>\n<li>Custom database validation on server (PHP) side and client side to prevent a broken code. PRO<\/li>\n<li>Help to implement THIS code. PRO<\/li>\n<\/ul>\n<hr>\n<div id=\"download\">\t<form id=\"edd_purchase_7572\" class=\"edd_download_purchase_form edd_purchase_7572\" method=\"post\">\n\n\t\t\t<div class=\"edd_price_options edd_single_mode\" >\n\t\t<ul>\n\t\t\t<li id=\"edd_price_option_7572_advancecommentedversioncode\"><label for=\"edd_price_option_7572_1\"><input type=\"radio\"  checked='checked' name=\"edd_options[price_id][]\" id=\"edd_price_option_7572_1\" class=\"edd_price_option_7572\" value=\"1\" data-price=\"11.99\"\/>&nbsp;<span class=\"edd_price_option_name\">Advance Commented Version Code<\/span><span class=\"edd_price_option_sep\">&nbsp;&ndash;&nbsp;<\/span><span class=\"edd_price_option_price\">&#36;11.99<\/span><\/label><\/li><li id=\"edd_price_option_7572_justcodenotadvance\"><label for=\"edd_price_option_7572_2\"><input type=\"radio\"  name=\"edd_options[price_id][]\" id=\"edd_price_option_7572_2\" class=\"edd_price_option_7572\" value=\"2\" data-price=\"6.99\"\/>&nbsp;<span class=\"edd_price_option_name\">Just code, not Advance<\/span><span class=\"edd_price_option_sep\">&nbsp;&ndash;&nbsp;<\/span><span class=\"edd_price_option_price\">&#36;6.99<\/span><\/label><\/li>\t\t<\/ul>\n\t<\/div><!--end .edd_price_options-->\n\t\n\t\t<div class=\"edd_purchase_submit_wrapper\">\n\t\t\t<button class=\"edd-add-to-cart button-cart edd-submit\" data-nonce=\"d05d3448e3\" data-timestamp=\"1782422252\" data-token=\"32134adb16a348f850e72352a14c5940d71874679e1b86247d82c63750437946\" data-action=\"edd_add_to_cart\" data-download-id=\"7572\"  data-variable-price=\"yes\" data-price-mode=single data-price=\"0.00\" ><span class=\"edd-add-to-cart-label\">Purchase<\/span> <span class=\"edd-loading\" aria-label=\"Loading\"><\/span><\/button><input type=\"submit\" class=\"edd-add-to-cart edd-no-js button-cart edd-submit\" name=\"edd_purchase_download\" value=\"Purchase\" data-action=\"edd_add_to_cart\" data-download-id=\"7572\"  data-variable-price=\"yes\" data-price-mode=single \/><a href=\"http:\/\/behstant.com\/blog\/checkout\/\" class=\"edd_go_to_checkout button-cart edd-submit\" style=\"display:none;\">Checkout<\/a>\n\t\t\t\t\t\t\t<span class=\"edd-cart-ajax-alert\" aria-live=\"assertive\">\n\t\t\t\t\t<span class=\"edd-cart-added-alert\" style=\"display: none;\">\n\t\t\t\t\t\t<svg class=\"edd-icon edd-icon-check\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"28\" height=\"28\" viewBox=\"0 0 28 28\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<path d=\"M26.11 8.844c0 .39-.157.78-.44 1.062L12.234 23.344c-.28.28-.672.438-1.062.438s-.78-.156-1.06-.438l-7.782-7.78c-.28-.282-.438-.673-.438-1.063s.156-.78.438-1.06l2.125-2.126c.28-.28.672-.438 1.062-.438s.78.156 1.062.438l4.594 4.61L21.42 5.656c.282-.28.673-.438 1.063-.438s.78.155 1.062.437l2.125 2.125c.28.28.438.672.438 1.062z\"\/>\n\t\t\t\t\t\t<\/svg>\n\t\t\t\t\t\tAdded to cart\t\t\t\t\t<\/span>\n\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div><!--end .edd_purchase_submit_wrapper-->\n\n\t\t<input type=\"hidden\" name=\"download_id\" value=\"7572\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"edd_action\" class=\"edd_action_input\" value=\"add_to_cart\">\n\t\t\n\t\t\n\t\t\n\t<\/form><!--end #edd_purchase_7572-->\n\t<\/div>\n<p><!--You can buy the\u00a0video\u00a0for only <strong>$14.99<\/strong> and I will show you step by step how to implement all this into your setup, as well as setting up the backend in PHP and creating the JSON response.\n\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post is the next part of Working with the jQuery Datatables plugin. Since this tutorial is written for those familiar with the plugin You might need to learn the basics of the plugin on the following link http:\/\/behstant.com\/blog\/jquery\/datatables-jquery-implementation\/. On this tutorial I am going to focus on how to manipulate the elements of the &#8230; <a title=\"jQuery Datatables sDom &#8211; Custom Elements\" class=\"read-more\" href=\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\" aria-label=\"Read more about jQuery Datatables sDom &#8211; Custom Elements\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":4086,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[25],"tags":[58,66,68,71,43,67,62,53,69,72],"class_list":["post-4199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","tag-ajax","tag-bootstrap","tag-database","tag-datatables","tag-javascript-2","tag-jquery","tag-php","tag-plugins","tag-tutorials","tag-video"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>jQuery Datatables sDom - Custom Elements &#187; The Code<\/title>\n<meta name=\"description\" content=\"Learn how to use the sDOM property of the jQuery Datatables plugin. You will learn to manipulate the positions of the jQuery Datatables elements.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"jQuery Datatables sDom - Custom Elements &#187; The Code\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the sDOM property of the jQuery Datatables plugin. You will learn to manipulate the positions of the jQuery Datatables elements.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\" \/>\n<meta property=\"og:site_name\" content=\"The Code\" \/>\n<meta property=\"article:published_time\" content=\"2019-02-14T21:42:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-14T21:46:50+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Reedyseth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Reedyseth\" \/>\n<meta name=\"twitter:site\" content=\"@Reedyseth\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Reedyseth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\"},\"author\":{\"name\":\"Reedyseth\",\"@id\":\"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\"},\"headline\":\"jQuery Datatables sDom &#8211; Custom Elements\",\"datePublished\":\"2019-02-14T21:42:42+00:00\",\"dateModified\":\"2019-02-14T21:46:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\"},\"wordCount\":1114,\"commentCount\":0,\"image\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png\",\"keywords\":[\"Ajax\",\"Bootstrap\",\"Database\",\"Datatables\",\"Javascript\",\"jQuery\",\"PHP\",\"Plugins\",\"Tutorials\",\"Video\"],\"articleSection\":[\"jQuery\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\",\"url\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\",\"name\":\"jQuery Datatables sDom - Custom Elements &#187; The Code\",\"isPartOf\":{\"@id\":\"http:\/\/behstant.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png\",\"datePublished\":\"2019-02-14T21:42:42+00:00\",\"dateModified\":\"2019-02-14T21:46:50+00:00\",\"author\":{\"@id\":\"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\"},\"description\":\"Learn how to use the sDOM property of the jQuery Datatables plugin. You will learn to manipulate the positions of the jQuery Datatables elements.\",\"breadcrumb\":{\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage\",\"url\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png\",\"contentUrl\":\"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png\",\"width\":200,\"height\":200,\"caption\":\"jQuery Datatables\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/behstant.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"jQuery Datatables sDom &#8211; Custom Elements\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/behstant.com\/blog\/#website\",\"url\":\"http:\/\/behstant.com\/blog\/\",\"name\":\"The Code\",\"description\":\"Learn Web Solutions in WordPress, PHP, jand also purchase code solutions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/behstant.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f\",\"name\":\"Reedyseth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g\",\"caption\":\"Reedyseth\"},\"description\":\"My Google Profile+\",\"sameAs\":[\"http:\/\/behstant.com\"],\"url\":\"http:\/\/behstant.com\/blog\/author\/reedyseth\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jQuery Datatables sDom - Custom Elements &#187; The Code","description":"Learn how to use the sDOM property of the jQuery Datatables plugin. You will learn to manipulate the positions of the jQuery Datatables elements.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/","og_locale":"en_US","og_type":"article","og_title":"jQuery Datatables sDom - Custom Elements &#187; The Code","og_description":"Learn how to use the sDOM property of the jQuery Datatables plugin. You will learn to manipulate the positions of the jQuery Datatables elements.","og_url":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/","og_site_name":"The Code","article_published_time":"2019-02-14T21:42:42+00:00","article_modified_time":"2019-02-14T21:46:50+00:00","og_image":[{"width":200,"height":200,"url":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png","type":"image\/png"}],"author":"Reedyseth","twitter_card":"summary_large_image","twitter_creator":"@Reedyseth","twitter_site":"@Reedyseth","twitter_misc":{"Written by":"Reedyseth","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#article","isPartOf":{"@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/"},"author":{"name":"Reedyseth","@id":"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f"},"headline":"jQuery Datatables sDom &#8211; Custom Elements","datePublished":"2019-02-14T21:42:42+00:00","dateModified":"2019-02-14T21:46:50+00:00","mainEntityOfPage":{"@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/"},"wordCount":1114,"commentCount":0,"image":{"@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage"},"thumbnailUrl":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png","keywords":["Ajax","Bootstrap","Database","Datatables","Javascript","jQuery","PHP","Plugins","Tutorials","Video"],"articleSection":["jQuery"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/","url":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/","name":"jQuery Datatables sDom - Custom Elements &#187; The Code","isPartOf":{"@id":"http:\/\/behstant.com\/blog\/#website"},"primaryImageOfPage":{"@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage"},"image":{"@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage"},"thumbnailUrl":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png","datePublished":"2019-02-14T21:42:42+00:00","dateModified":"2019-02-14T21:46:50+00:00","author":{"@id":"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f"},"description":"Learn how to use the sDOM property of the jQuery Datatables plugin. You will learn to manipulate the positions of the jQuery Datatables elements.","breadcrumb":{"@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#primaryimage","url":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png","contentUrl":"http:\/\/behstant.com\/blog\/wp-content\/uploads\/2015\/11\/feature_datatables-01.png","width":200,"height":200,"caption":"jQuery Datatables"},{"@type":"BreadcrumbList","@id":"http:\/\/behstant.com\/blog\/jquery\/jquery-datatables-sdom\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/behstant.com\/blog\/"},{"@type":"ListItem","position":2,"name":"jQuery Datatables sDom &#8211; Custom Elements"}]},{"@type":"WebSite","@id":"http:\/\/behstant.com\/blog\/#website","url":"http:\/\/behstant.com\/blog\/","name":"The Code","description":"Learn Web Solutions in WordPress, PHP, jand also purchase code solutions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/behstant.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/behstant.com\/blog\/#\/schema\/person\/760327e1ee480ad2aabe8e40d784ec9f","name":"Reedyseth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/117af509aa15be89968fe955258a7bf8ed362ec2adf1afcf2af50a976f2349fa?s=96&r=g","caption":"Reedyseth"},"description":"My Google Profile+","sameAs":["http:\/\/behstant.com"],"url":"http:\/\/behstant.com\/blog\/author\/reedyseth\/"}]}},"_links":{"self":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/4199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/comments?post=4199"}],"version-history":[{"count":54,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/4199\/revisions"}],"predecessor-version":[{"id":8385,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/posts\/4199\/revisions\/8385"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/media\/4086"}],"wp:attachment":[{"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/media?parent=4199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/categories?post=4199"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/behstant.com\/blog\/wp-json\/wp\/v2\/tags?post=4199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}