<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>DataTables 2 — DataTables forums</title>
        <link>https://datatables.net/forums/</link>
        <pubDate>Mon, 13 Apr 2026 11:27:03 +0000</pubDate>
        <language>en</language>
            <description>DataTables 2 — DataTables forums</description>
    <language>en</language>
    <atom:link href="https://datatables.net/forums/categories/datatables-2/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Hover is not highlighting rows</title>
        <link>https://datatables.net/forums/discussion/81740/hover-is-not-highlighting-rows</link>
        <pubDate>Sun, 12 Apr 2026 13:02:36 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>Mwhite007</dc:creator>
        <guid isPermaLink="false">81740@/forums/discussions</guid>
        <description><![CDATA[<p>in order to control color scheme on my table, you gave me a small function which works great mostly:</p>

<pre><code>     /* ANY ADDED ROW SHOULD HAVE THE 'DATA' CLASS ADDED */
    createdRow: function ( tr ) {
        $(tr).addClass('data');
    },
</code></pre>

<p>but i think this kills the hover/highlight function on the dataTable tbody rows. if i remove the createdRow function the highlighting works on hover but i lose the css from the color scheme i have</p>
]]>
        </description>
    </item>
    <item>
        <title>Problem with Filter placement on mobile</title>
        <link>https://datatables.net/forums/discussion/81735/problem-with-filter-placement-on-mobile</link>
        <pubDate>Thu, 09 Apr 2026 22:36:12 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>jdadwilson</dc:creator>
        <guid isPermaLink="false">81735@/forums/discussions</guid>
        <description><![CDATA[<p>Long time user of DataTables. I've noticed that when viewed on a mobile device the normally right (dt-end) aligned dt-filter is placed immediately following the dt-length. Is there a solution to this problem?</p>
]]>
        </description>
    </item>
    <item>
        <title>migration recipe from 1.x to 2.x?</title>
        <link>https://datatables.net/forums/discussion/81701/migration-recipe-from-1-x-to-2-x</link>
        <pubDate>Fri, 27 Feb 2026 10:56:06 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>louking</dc:creator>
        <guid isPermaLink="false">81701@/forums/discussions</guid>
        <description><![CDATA[<p>I haven't tried to migrate yet because I have a lot of code and it sounds daunting. I have both datatabases and editor. I see you're working on release 3 now, and I don't want to be further behind...</p>

<p>Is there a recipe somewhere for the migration requirements?</p>
]]>
        </description>
    </item>
    <item>
        <title>Save form data offline</title>
        <link>https://datatables.net/forums/discussion/81691/save-form-data-offline</link>
        <pubDate>Fri, 20 Feb 2026 05:23:24 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>Hildeb67</dc:creator>
        <guid isPermaLink="false">81691@/forums/discussions</guid>
        <description><![CDATA[<p>Hello, I have a mobile application used on a tablet.<br />
The internet connection frequently drops. Is there a way to temporarily save the form data and upload it to the server when an internet connection is established? Is this possible with DataTables Form? Ideally, I'd like the data to be saved every time the user leaves the form field. Thanks and regards, Chris</p>
]]>
        </description>
    </item>
    <item>
        <title>jQuery 4.0.0 compatibility</title>
        <link>https://datatables.net/forums/discussion/81623/jquery-4-0-0-compatibility</link>
        <pubDate>Sat, 24 Jan 2026 12:10:45 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>Mwhite007</dc:creator>
        <guid isPermaLink="false">81623@/forums/discussions</guid>
        <description><![CDATA[<p>I use DataTables 2.3.6. what is the state of jQuery 4.0.0 compatibility with DataTables?</p>
]]>
        </description>
    </item>
    <item>
        <title>Displaying Editor stacked fields in 2 rows</title>
        <link>https://datatables.net/forums/discussion/81622/displaying-editor-stacked-fields-in-2-rows</link>
        <pubDate>Sat, 24 Jan 2026 01:15:34 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>lowrymel</dc:creator>
        <guid isPermaLink="false">81622@/forums/discussions</guid>
        <description><![CDATA[<p>This is a question around the Datatables as an Input example - Parent Child relationship.<br />
Here is a screenshot of the userEdit screen.  <img src="https://datatables.net/forums/uploads/editor/wc/49ux2cek88uq.png" alt="" title="" /><br />
What I want to do is to put the First Name and Last Name on one row and the remaining 2 fields on a second row.  Then I want them to go stacked when the screen is resized.   BTW they are currently being displayed (my local version) using the settings of  display: 'bootstrap' and     bootstrap: { floatingLabels: true },<br />
which increases the current screen white space even more leaving a lot of unused real estate.</p>

<p>Any assistance is greatly appreciated.<br />
Thanks in advance!</p>
]]>
        </description>
    </item>
    <item>
        <title>How to update the display value and not the underlying value?</title>
        <link>https://datatables.net/forums/discussion/81615/how-to-update-the-display-value-and-not-the-underlying-value</link>
        <pubDate>Tue, 20 Jan 2026 03:06:51 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>lowrymel</dc:creator>
        <guid isPermaLink="false">81615@/forums/discussions</guid>
        <description><![CDATA[<p>How can I update only the displayed value for a cell that contains an underlying array where a render is being used to  display the array.length?</p>

<p>In the example <a rel="nofollow" href="https://editor.datatables.net/examples/datatables/parentChild.html">https://editor.datatables.net/examples/datatables/parentChild.html</a></p>

<p>The user count is conditioned with a render.</p>

<p>var siteTable = $('#sites').DataTable({<br />
    ajax: '../php/sites.php',<br />
    columns: [<br />
        { data: 'name' },<br />
        {<br />
            data: 'users',<br />
            render: function (data) {<br />
                return data.length;<br />
            }<br />
        }<br />
    ],</p>

<p>Since this is not persistent data (client display only) I would like to update the displayed values on Add actions and Delete Actions.   Seems unnecessary to round trip reloading the table to get the counters adjusted.</p>

<p>Thanks in advance.</p>
]]>
        </description>
    </item>
    <item>
        <title>sticky columns plus sticky headers plus horizontal scrolling ?</title>
        <link>https://datatables.net/forums/discussion/81609/sticky-columns-plus-sticky-headers-plus-horizontal-scrolling</link>
        <pubDate>Sat, 10 Jan 2026 19:03:59 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>veloopity</dc:creator>
        <guid isPermaLink="false">81609@/forums/discussions</guid>
        <description><![CDATA[<p>I have problems with a large table with these properties:</p>

<ol>
<li>there is a horizontal scrollbar on top of the table above the table headers </li>
<li>the first three columns need to be fixed when scrolling horizontally</li>
<li>the headers need to be fixed (sticky) on the top of the page when scrolling down</li>
<li>when scrolling down and right, the column headers need to stay fixed on the top of the page but they need to scroll horizontally, while not overlapping the headers of the left 3 fixed columns.</li>
</ol>

<p>I don't want programming help right now, I just wonder if anyone has created an online example with these or similar properties. Is this technically possible at all? The examples I found for sticky headers [<a rel="nofollow" href="https://datatables.net/extensions/responsive/examples/column-control/fixedHeader.html]">https://datatables.net/extensions/responsive/examples/column-control/fixedHeader.html]</a> are too simple and don't scroll horizontally and don't have sticky columns.</p>
]]>
        </description>
    </item>
    <item>
        <title>Dispatch 3 items into 3 lines</title>
        <link>https://datatables.net/forums/discussion/81579/dispatch-3-items-into-3-lines</link>
        <pubDate>Thu, 18 Dec 2025 19:50:11 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>Guiraute</dc:creator>
        <guid isPermaLink="false">81579@/forums/discussions</guid>
        <description><![CDATA[<p>Hi,<br />
I have a column like that<br />
           {<br />
               data: 'phases',render: '[, ].phases.page'<br />
            },<br />
who displays that :<br />
crea_identifiants, crea_mdp, verif_doublon, adhesion_rev</p>

<p>Can you help me to display each item per line like that :<br />
crea_identifiants<br />
crea_mdp, verif_doublon<br />
adhesion_rev</p>

<p>BR from Francis</p>
]]>
        </description>
    </item>
    <item>
        <title>How to migrate DataTables 1.10 select-checkbox  to the new select extension</title>
        <link>https://datatables.net/forums/discussion/81566/how-to-migrate-datatables-1-10-select-checkbox-to-the-new-select-extension</link>
        <pubDate>Wed, 10 Dec 2025 09:31:42 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>ltdeta</dc:creator>
        <guid isPermaLink="false">81566@/forums/discussions</guid>
        <description><![CDATA[<p>With dt 1.10.23 I am using a checkbox at first td as following</p>

<p><strong>PHP variable output with a single-row example data</strong></p>

<pre><code>columnsDef: array (
  0 =&gt; 
  (object) array(
     'title' =&gt; '&lt;input  type=\'checkbox\'  id=\'configCboToggle\' style=\'padding:4px 0 0 0;\' value=\'0\' title=\'alle\'/&gt;',
     'visible' =&gt; true,
     'className' =&gt; 'dt-head-center dt-body-center',
     'orderable' =&gt; false,
     'searchable' =&gt; false,
     'targets' =&gt; 
    array (
      0 =&gt; 0,
    ),
  ),
  1 =&gt; 
  (object) array(
     'title' =&gt; 'ID',
     'visible' =&gt; true,
     'className' =&gt; 'dt-head-center dt-body-center',
     'orderable' =&gt; true,
     'searchable' =&gt; true,
     'targets' =&gt; 
    array (
      0 =&gt; 1,
    ),
  ),
)

data: array (
  0 =&gt; 
  array (
    0 =&gt; 
    array (
      'text' = '&lt;div class="chkWrap configCbo" style="display:inline-block;"&gt;&lt;input type="checkbox" id="configCbo0" /&gt;
               &lt;i class="fa-regular fa-trash-can fa-custom-hl fa-lg icon-rowDel" title="not deletable"&gt;&lt;/i&gt;
               &lt;i class="fa fa-gear fa-custom-hl fa-lg icon-rowAction" title="no action!"&gt;&lt;/i&gt;
             &lt;/div&gt;'
      'dataConfig' =&gt; 'id&amp;trade;ID&amp;#9638;12&amp;#9638;fedit1&amp;#9638;12&amp;loz;rowdel&amp;trade;1&amp;loz;rowedit&amp;trade;1&amp;loz;rowzaction&amp;trade;1&amp;loz;idza&amp;trade;',
    ),
    1 =&gt; '17',
  ),
)
</code></pre>

<p><strong>js snippet setting the data into the table</strong></p>

<pre><code>  rowCallback: function(nRow, aData) {
      $('td:eq(0)', nRow).html(aData[0].text);
      $('td:eq(0)', nRow).attr('data-config', aData[0].dataConfig);
  }
</code></pre>

<p><strong>html code looks like</strong></p>

<pre><code>&lt;tr&gt;
 &lt;td class="dt-head-center dt-body-center"
    data-config="id&amp;trade;Spalte1&amp;#9638;17&amp;#9638;fedit1&amp;#9638;17&amp;#9638;Spalte9&amp;#9638;&amp;#9638;fedit10&amp;#9638;&amp;loz;rowdel&amp;trade;2&amp;loz;rowedit&amp;trade;1&amp;loz;rowzaction&amp;trade;0&amp;loz;idza&amp;trade;COL1&amp;OElig;17~COL2&amp;OElig;ROUTE1~COL4&amp;OElig;K'KGGGOOO~COL5&amp;OElig;"
    style="cursor: pointer;"&gt;
    &lt;div class="chkWrap configCbo" style="display:inline-block;"&gt;
        &lt;input type="checkbox" id="configCbo0"&gt;
        &lt;i class="fa-regular fa-trash-can fa-custom-hl fa-lg icon-rowDel" title="not deletable"&gt;&lt;/i&gt;
        &lt;i class="fa fa-gear fa-custom-hl fa-lg icon-rowAction" title="no action!"&gt;&lt;/i&gt;
    &lt;/div&gt;
&lt;/td&gt;

&lt;/tr&gt;
</code></pre>

<p>How can I use the new select extension without losing my custom div</p>
]]>
        </description>
    </item>
    <item>
        <title>Reference to buttons.name in config</title>
        <link>https://datatables.net/forums/discussion/81506/reference-to-buttons-name-in-config</link>
        <pubDate>Tue, 11 Nov 2025 09:17:05 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>BjornHa</dc:creator>
        <guid isPermaLink="false">81506@/forums/discussions</guid>
        <description><![CDATA[<p>Is it possibe to use the buttons.name setting to activate a set of buttons in a layout definition? (like 'buttons:main' or similar)<br />
I would like to define multiple sets of buttons in the default settings and be able to refer to them in the config locally, but maybe this needs to be done through API calls after config?<br />
KR, Bjørn H</p>
]]>
        </description>
    </item>
    <item>
        <title>Has anyone incorporated the softdelete example into the parentchild datatables example?</title>
        <link>https://datatables.net/forums/discussion/81523/has-anyone-incorporated-the-softdelete-example-into-the-parentchild-datatables-example</link>
        <pubDate>Mon, 17 Nov 2025 15:52:49 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>lowrymel</dc:creator>
        <guid isPermaLink="false">81523@/forums/discussions</guid>
        <description><![CDATA[<p>I think this is due to the dynamic nature of the child datatables in the parentChild example.<br />
Apologizes if this has been answered previously, but I did not find anything in the search.</p>

<p>The line in the below code that is the issue (I think) is ' var rows = DataTables_Table_0.rows({ selected: true }).indexes();' which does not work.   I attempted using the ID from inspect since there is no obvious instantiation of the datatable in question (at least that I can see).</p>

<p>Any ideas?</p>

<p>Thanks in advance!</p>

<pre><code>{
    label: 'Users:',
    name: 'users.site',
    type: 'datatable',
    editor: usersEditor,
    submit: false,
    optionsPair: {
        value: 'users.id'
    },
    config: {
        ajax: {
            url: '../controllers/NEWuser/users.php',
            type: 'post',
            data: function (d) {
                if (siteTable) {
                    var selected = siteTable.row({ selected: true });
                    if (selected.any()) {
                        d.site = selected.data().id;
                    }
                }
            }
        },
        buttons: [
            { extend: 'create', editor: usersEditor },
            { extend: 'edit', editor: usersEditor },
           //{ extend: 'remove', editor: usersEditor }
 
 
            {
            extend: 'selected',
            text: 'Delete',
            action: function (e, dt, node, config) {
 
 
                var rows = DataTables_Table_0.rows({ selected: true }).indexes();
 
                usersEditor
                    .hide(usersEditor.fields())
                    .one('close', function () {
                        setTimeout(function () {
                            // Wait for animation
                            usersEditor.show(usersEditor.fields());
                        }, 500);
                    })
                    .edit(rows, {
                        title: 'Delete',
                        message:
                            rows.length === 1
                                ? 'Are you sure you wish to delete this row?'
                                : 'Are you sure you wish to delete these ' +
                                  rows.length +
                                  ' rows',
                        buttons: 'Delete'
                    })
                    .val(
                        'removed_date',
                        new Date().toISOString().split('T')[0]
                    );
            }
        }                  
 
        ],
        columns: [
            {
                data: 'users.first_name',
                title: 'First name'
            },
            {
                data: 'users.last_name',
                title: 'Last name'
            },
            {
                data: 'users.phone',
                title: 'Phone'
            }
        ]
    }
}
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>search highlighting using mark.js</title>
        <link>https://datatables.net/forums/discussion/81515/search-highlighting-using-mark-js</link>
        <pubDate>Fri, 14 Nov 2025 12:10:16 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>ltdeta</dc:creator>
        <guid isPermaLink="false">81515@/forums/discussions</guid>
        <description><![CDATA[<p>I would like to implement search highlighting using mark.js with DataTables 2<br />
<a rel="nofollow" href="https://datatables.net/blog/2017/search-highlighting-with-markjs#Adding-custom-mark.js-options">https://datatables.net/blog/2017/search-highlighting-with-markjs#Adding-custom-mark.js-options</a></p>

<p>JS Bin test case<br />
<a rel="nofollow" href="https://live.datatables.net/teripiyu/1/edit">https://live.datatables.net/teripiyu/1/edit</a></p>

<p>I want to add custom mark.js options, such as wildcard search, but it only works when I trigger the search manually.</p>

<pre><code>$("#example").mark("R*os", {
    wildcards: "enabled",
    caseSensitive: true
});
</code></pre>

<p>Using the same settings to initialize the DataTable, the search functionality in the search field is not working when typing.</p>

<pre><code>var table = new DataTable('#example',
 { mark:
    {  wildcards: "enabled",
      caseSensitive: true
    }
 }                         
);
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>grid layout - show custom div behind a feature element</title>
        <link>https://datatables.net/forums/discussion/81507/grid-layout-show-custom-div-behind-a-feature-element</link>
        <pubDate>Tue, 11 Nov 2025 12:44:41 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>ltdeta</dc:creator>
        <guid isPermaLink="false">81507@/forums/discussions</guid>
        <description><![CDATA[<p>How can I insert a custom div directly after the layout element paging?<br />
Currently, it is displayed as a separate cell in the grid.</p>

<p><a rel="nofollow" href="https://live.datatables.net/mijifezi/1/edit?html,css,output">https://live.datatables.net/mijifezi/1/edit?html,css,output</a></p>

<pre><code>&lt;div class="dt-layout-row"&gt;
  &lt;div class="dt-layout-cell dt-layout-full"&gt;&lt;/div&gt;
  &lt;div class="dt-length"&gt;&lt;/div&gt;
  &lt;div class="custom-div"&gt;hallo&lt;/div&gt;
  &lt;div class="dt-search"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p><strong>current</strong><br />
<img src="https://datatables.net/forums/uploads/editor/oj/abs8iadncwew.png" alt="" title="" /></p>

<p><strong>what i want</strong><br />
<img src="https://datatables.net/forums/uploads/editor/mv/lilcpnbbn8e0.png" alt="" title="" /></p>
]]>
        </description>
    </item>
    <item>
        <title>Example of how to use fetch() with DataTables React component</title>
        <link>https://datatables.net/forums/discussion/81503/example-of-how-to-use-fetch-with-datatables-react-component</link>
        <pubDate>Sun, 09 Nov 2025 02:36:30 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>aklietz</dc:creator>
        <guid isPermaLink="false">81503@/forums/discussions</guid>
        <description><![CDATA[<p>The DataTables React component is very nice.</p>

<p>I like how changing the <code>data</code> prop triggers a re-render.  I utilized this behavior to implement a simple server-side fetch() that asynchronously populates the initial DataTable.</p>

<p>The following React component, called <code>FetchDataTable</code>,  fetches the table data from a server using the browser API <code>fetch</code>. It is much easier to use than <code>ajax</code> for smaller tables.</p>

<p>FetchDataTable.jsx:</p>

<pre><code>//
// FetchDataTable.jsx -- Wrapper for DataTables React component with fetch()
//

import { useState, useEffect, createContext } from 'react';

function useFetch(fetchUrl, fetchOptions) {
    const [tableData, setTableData] = useState([]/*empty table*/);
    const [isLoading, setIsLoading] = useState(true);
    const [errorMsg, setErrorMsg] = useState(null);

    useEffect(() =&gt; {

        const fetchData = async () =&gt; {

        try {
            setIsLoading(true);

            // fetch() default options
            const opts = Object.assign({
                method: 'GET', // or 'POST'
                cache: 'no-store',
                //credentials: 'same-origin', // default
                headers: { // if POST
                    'Content-Type': 'application/json; charset=utf-8',
                    //'Content-Type': 'application/x-www-form-url-encoded; charset=utf-8',
                },
                //body: JSON.stringify(data), // if POST
                redirect: 'error',
            }, fetchOptions);

            const response = await fetch(fetchUrl, opts);

            if (!response.ok) { // Got non-200 range response (404, etc)
                throw new Error(`Server request failed: Error ${response.status}`);
            }

            let text = await response.text();

            const json = JSON.parse(text); // Throws SyntaxError if bad JSON

            if (json.error) {
                throw new Error(json.error);
            }

            const data = json.data;

            if (Array.isArray(data)) {
                setTableData(data);
            } else {
                throw new Error('Server did not return data[]');
            }
        } catch(err) {
          setErrorMsg(err.message);
        } finally {
          setIsLoading(false);
        }
      };

      fetchData(); // Start the async data fetch

      return () =&gt; {
           // Do useEffect cleanup here
      };

    }, []/*once*/); // end useEffect()

    const props = {
        tableData,
        setTableData,
        errorMsg,
        isLoading
    };

    return props;
}

/*
Expected JSON response:
{
  data: [
        { "UserId": 123, "FirstName":"Bob", "LastName":"Smith", "Role": "Manager" },
        { "UserId": 456, "FirstName":"Roger", "LastName":"Kline", "Role": "Tech Support" },
        { "UserId": 789, "FirstName":"Julie", "LastName":"Adams", "Role": "Sales" }
  ]
}

If an error occurs, the expected JSON response is

{ error: "Error message" }
*/

////////////////////////////////////////////////////////////////////////////
//
// Wrapper for &lt;DataTable data={tableData}&gt;
//
//

// Context to pass the fetched data down to the DataTable component
export const FetchDataTableContext = createContext({});

export function FetchDataTable({fetchUrl, fetchOptions, children}) {

    // Note the use of braces {}, not []
    const {tableData, setTableData, errorMsg, isLoading} = useFetch(fetchUrl, fetchOptions);

    if (isLoading) {
        return (
            &lt;h1&gt;Loading data...&lt;/h1&gt;
        );
    }

    if (errorMsg) {
        return (
            &lt;p style={{ color: "red" }}&gt;Error: {errorMsg}&lt;/p&gt;
        );
    }

    const contextData = { tableData, setTableData };

    return(
        &lt;FetchDataTableContext value={contextData}&gt;
          {children}
        &lt;/FetchDataTableContext&gt;
    );
}
</code></pre>

<p>The following is a simple React app that uses the <code>FetchDataTable</code> component to populate a DataTable.</p>

<p>The example uses Bootstrap 5.</p>

<p>App.jsx:</p>

<pre><code>// Example App

import { createRoot } from 'react-dom/client';
import { useRef, useState, useEffect, useContext } from 'react';

import * as bootstrap from 'bootstrap';
import DataTable from 'datatables.net-react';
import DT from 'datatables.net-bs5';

import 'bootstrap/dist/css/bootstrap.css';

import { FetchDataTable, FetchDataTableContext } from './FetchDataTable';

DT.use(bootstrap);
DataTable.use(DT);

function MyDataTable()
{
    const dtTable = useRef(); // Create a DT ref (Normally only plain DOM elements are allowed here, but DataTable is a special case)

    //Provides context.tableData, context.setTableTable()
    const context = useContext(FetchDataTableContext);

    const options = {

        lengthMenu: [2, 10, 25, 50, 100],

        // Put other options here

        columns: [
            { data: 'UserId' },
            { data: 'FirstName' },
            { data: 'LastName' },
            { data: 'Role' },
        ],
    };

    return (
        &lt;DataTable id="users" ref={dtTable}
              data={context.tableData}
              options={options}
              className="display table table-striped table-bordered"&gt;
            &lt;thead&gt;
                &lt;th&gt;UserId&lt;/th&gt;
                &lt;th&gt;First Name&lt;/th&gt;
                &lt;th&gt;Last Name&lt;/th&gt;
                &lt;th&gt;Role&lt;/th&gt;
            &lt;/thead&gt;
            &lt;tbody&gt;
            &lt;/tbody&gt;
        &lt;/DataTable&gt;
    );
}

/////////////////////////////////////////////////////////////////////////////
//
function App() {

    const fetchUrl = 'https://my-site-name/my-api'
    const fetchOptions = { 'method': 'GET' };

    return (
      &lt;div className="container"&gt;
        &lt;FetchDataTable fetchUrl={fetchUrl} fetchOptions={fetchOptions}&gt;
          &lt;MyDataTable /&gt;
        &lt;/FetchDataTable&gt;
      &lt;/div&gt;
    );
}

/////////////////////////////////////////////////////////////////////////////

export const root = createRoot(document.getElementById("root"));

root.render(
    &lt;App /&gt;
);

</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>Formating a rendered number of a column</title>
        <link>https://datatables.net/forums/discussion/81493/formating-a-rendered-number-of-a-column</link>
        <pubDate>Sun, 02 Nov 2025 17:51:55 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>carrarachristophe</dc:creator>
        <guid isPermaLink="false">81493@/forums/discussions</guid>
        <description><![CDATA[<p>Hello,<br />
I have a number column that I am rendering that way:</p>

<pre><code>{data: "reporting_header.balance_CLBD_amount_amount", render: DataTable.render.number(null, null, 2), className: 'dt-body-right' }
</code></pre>

<p>But I must add a condition statement which calculate the value of the column:</p>

<pre><code>{data: null, render: function ( data, type, row ) {
     if (data.reporting_header.balance_CLBD_credit_debit_indicator === 'DBIT') {
          return -1 * data.reporting_header.balance_CLBD_amount_amount;
     } else {
          return data.reporting_header.balance_CLBD_amount_amount;
     }
}}
</code></pre>

<p>How can I add to the second code the formating of the first?</p>
]]>
        </description>
    </item>
    <item>
        <title>Horizontal scroll bar and information area hide when screen height is reduced</title>
        <link>https://datatables.net/forums/discussion/81446/horizontal-scroll-bar-and-information-area-hide-when-screen-height-is-reduced</link>
        <pubDate>Mon, 13 Oct 2025 13:18:19 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>jladbury</dc:creator>
        <guid isPermaLink="false">81446@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>: <a rel="nofollow" href="https://berricktest.co.uk/dist/index.htm" title="https://berricktest.co.uk/dist/index.htm"></a><a rel="nofollow" href="https://berricktest.co.uk/dist/index.htm">https://berricktest.co.uk/dist/index.htm</a><br />
<strong>Debugger code (debug.datatables.net)</strong>: ilixej (2.2.2)  ayucof(1.13.6)<br />
<strong>Error messages shown</strong>: n/a<br />
<strong>Description of problem</strong>: When horizontal scrolling is active ('scrollX': 'true'), the horizontal scroll bar disappears when the screen height is reduced.  This did not occur with 1.13.6. I believe the root cause is the change from this dom setting:<br />
<code>'dom': '&lt;"c9tableTools01"Bf&gt;&lt;".c9table-body"t&gt;&lt;"c9tableTools02"lipr&gt;',</code><br />
to this layout:</p>

<pre><code>            'layout': {
                topStart: 'buttons',
                topEnd: 'search',
                bottomStart: {
                    info: {
                        text: 'Displaying _START_ to _END_ of _TOTAL_ events'
                    }
                },
                bottomEnd: ''
            },
</code></pre>

<p>I have made a short video which shows the problem. Please see <a rel="nofollow" href="https://berricktest.co.uk/datatablesScrollbarProblem.mp4" title="https://berricktest.co.uk/datatablesScrollbarProblem.mp4"></a><a rel="nofollow" href="https://berricktest.co.uk/datatablesScrollbarProblem.mp4">https://berricktest.co.uk/datatablesScrollbarProblem.mp4</a></p>
]]>
        </description>
    </item>
    <item>
        <title>Big questions about DataTables 2 and a lot of extensions</title>
        <link>https://datatables.net/forums/discussion/81397/big-questions-about-datatables-2-and-a-lot-of-extensions</link>
        <pubDate>Fri, 26 Sep 2025 10:26:58 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>slolo</dc:creator>
        <guid isPermaLink="false">81397@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>: <a rel="nofollow" href="https://live.datatables.net/delovaki/1/edit">https://live.datatables.net/delovaki/1/edit</a><br />
<strong>Debugger code (debug.datatables.net)</strong>: NA<br />
<strong>Error messages shown</strong>: NA<br />
<strong>Description of problem</strong>: Hello,</p>

<p>I created a large test case that covers all the features I'm trying to use with version 2 (v2.3.4 at the time of writing this post) of the DataTables component as well as almost all the extensions.</p>

<p>But first, here are the specifics of my example:<br />
- The DataTable uses the columnControl extension and has two header rows.<br />
- The table rows contain HTML code and controls, as well as SVG-type images.<br />
- Some columns are intentionally hidden to be displayed as child rows (the "Column Visibility" button is for example purposes only).</p>

<p>Here is the list of points I would like to achieve:</p>

<p><strong>1./ Avoid exporting specific columns</strong></p>

<p>As you can see, when I click on the "copy" button, I get the result below:</p>

<pre><code>id  Name    E-mail  Date    SKU Qty Code    Info    Actions
00001   Name 1  email1@domain.com   2025-09-01          123     Delete
00002   Name 2  email2@domain.com   2025-08-05          456     Delete
</code></pre>

<p>There shouldn't be the "Info" and "Action" columns and I'm also missing the values ​​for the "SKU" and "Qty" columns.</p>

<blockquote>
  <p></p>
</blockquote>

<p><strong>2./ Avoid being able to move columns by dragging and dropping cells in row 2</strong></p>

<p>What option should I apply to prevent the 2nd row from allowing column movement?</p>

<blockquote>
  <p></p>
</blockquote>

<p><strong>3./ Avoid retrieving the HTML code of the column header</strong></p>

<p><img src="https://datatables.net/forums/uploads/editor/wq/oc7qwreanyio.png" alt="" title="" /></p>

<p>As you can see, I'm creating a child row with the names of the hidden columns as well as the cell contents associated with the column.<br />
But when I retrieve the column name (see code below), I get the entire HTML code, not just the column title.<br />
Is there a way to avoid this?</p>

<pre><code>    lRow.columns(".col-in-row-child").every( function(colIdx) {
      var lCell = oTable.cell(rowIdx, colIdx);
      var lColHeader = oTable.column(colIdx).header();
      if (lCell.data() !== "") {
        lExtraInfo += "&lt;p&gt;&lt;strong&gt;" + $(lColHeader).html() + " : &lt;/strong&gt;" + lCell.data() + "&lt;/p&gt;";
      }
    } );
</code></pre>

<blockquote>
  <p></p>
</blockquote>

<p><strong>4./ In the SearchBuilder component, there should not be the 2 columns "Info" and "Action"</strong></p>

<p><img src="https://datatables.net/forums/uploads/editor/t4/e5z73gg5c9zn.png" alt="" title="" /></p>

<p>I used a class named .no-col-extended-search and set the "columnDefs" property to normally prevent them from being visible, but it didn't change anything.<br />
What did I forget to do?</p>

<blockquote>
  <p></p>
</blockquote>

<p><strong>5./ In the SearchPanes component, the "SKU" and "Qty" columns are missing</strong></p>

<p><img src="https://datatables.net/forums/uploads/editor/a2/brw8xqv9n8eg.png" alt="" title="" /></p>

<p>What did I miss knowing that they appear well in the SearchPanes component.</p>

<blockquote>
  <p></p>
</blockquote>

<p><strong>6./ Would it be possible to have an option to reset the columnControl component's search field via the ESC keyboard key?</strong></p>

<p>When you enter a filter with the keyboard, it is much faster to reset the field via a keyboard key than having to pick up your mouse again to click on the cross.</p>

<blockquote>
  <p></p>
</blockquote>

<p><strong>7./ Problem when refreshing DataTables when deleting a row</strong></p>

<p>I'm providing a link to a problem I've already encountered so that you don't forget that it exists ;-)</p>

<p><a rel="nofollow" href="https://datatables.net/forums/discussion/81377/problem-to-delete-a-row-in-datatables-works-in-v1-but-not-in-v2" title="https://datatables.net/forums/discussion/81377/problem-to-delete-a-row-in-datatables-works-in-v1-but-not-in-v2"></a><a rel="nofollow" href="https://datatables.net/forums/discussion/81377/problem-to-delete-a-row-in-datatables-works-in-v1-but-not-in-v2">https://datatables.net/forums/discussion/81377/problem-to-delete-a-row-in-datatables-works-in-v1-but-not-in-v2</a></p>

<p>cf. code below:</p>

<pre><code>  $("body").on('click', 'button.btn[data-action="delete"]', function () {
    // Works well
    //mytable.row($(this).parents('tr')).remove().draw();

    // Does not work well
    deleteRow(this);
  });

  function deleteRow(ele) {
    var objInfo = $(ele).closest("tr");
    //console.log(ele);
    oTable.row($(objInfo)).remove().draw(false);
  }
</code></pre>

<blockquote>
  <p></p>
</blockquote>

<p><strong>8./ Problem when SearchPanes or searchBuilder is on the right of the layout</strong></p>

<p>We have already discussed this issue and there is no solution to date. I am just bringing it up again so I don't forget ;-)</p>

<pre><code>  var gDataTablesExtendedSearch = {
    "searchBuilder": {
      // If positionned to the right, searchBuilder is hidden on the right side (change "layout" comment to see the difference with right side)
    "searchPanes": {
      // If positionned to the right, searchPanes is hidden on the right side (change "layout" comment to see the difference with left side)
</code></pre>

<blockquote>
  <p></p>
</blockquote>

<p>Thanks in advance for your help and I hope I could implement all these features to my DataTables, it would be just awesome!!!</p>

<p>Lolo.</p>
]]>
        </description>
    </item>
    <item>
        <title>Problem to delete a row in DataTables (works in v1 but not in v2)</title>
        <link>https://datatables.net/forums/discussion/81377/problem-to-delete-a-row-in-datatables-works-in-v1-but-not-in-v2</link>
        <pubDate>Fri, 19 Sep 2025 14:11:47 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>slolo</dc:creator>
        <guid isPermaLink="false">81377@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>: <a rel="nofollow" href="https://live.datatables.net/nujinizi/1/edit">https://live.datatables.net/nujinizi/1/edit</a><br />
<strong>Debugger code (debug.datatables.net)</strong>:<br />
<strong>Error messages shown</strong>: "TypeError: Cannot read properties of null (reading 'nTr') at x ...<br />
<strong>Description of problem</strong>: I have a small piece of code which work well with DataTables 1.13.11</p>

<p>I try to delete a row with DataTables v2.3.4</p>

<p>The code below works with v2 (extract from DataTables documentation)</p>

<pre><code>var mytable = $("#dttable").DataTable(dataTableParam);

$("body").on('click', 'button.btn[data-action="delete"]', function () {
    mytable.row($(this).parents('tr')).remove().draw();
});
</code></pre>

<p>But this one does not work with v2.x (but works with v1.x)</p>

<pre><code>var mytable = $("#dttable").DataTable(dataTableParam);

$("body").on('click', 'button.btn[data-action="delete"]', function () {
    deleteRow(this);
});

function deleteRow(ele) {
    var objInfo = $(ele).closest("tr");
    mytable.row($(objInfo)).remove().draw("page");
}
</code></pre>

<p>I suppose that something has changed with the new version but I would like to understand what is the difference between the 2 pieces of code</p>

<p>Otherwise nothing to do, is there a chance that the problem with Bootstrap 4 and Cards is resolved with the SearchPanes component when it is positioned to the right in the layout?</p>

<p>Thanks in advance for your help and have a nice day.</p>
]]>
        </description>
    </item>
    <item>
        <title>row(index).deselect() or  rows({ selected: true }).deselect(); not working</title>
        <link>https://datatables.net/forums/discussion/81372/row-index-deselect-or-rows-selected-true-deselect-not-working</link>
        <pubDate>Thu, 18 Sep 2025 10:33:59 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>toomanylogins</dc:creator>
        <guid isPermaLink="false">81372@/forums/discussions</guid>
        <description><![CDATA[<p>I am using,</p>

<ul>
<li>Included libraries:</li>
<li>DataTables 2.2.0, Editor 2.4.0, Buttons 3.2.0, Responsive 3.0.3, Select 3.0.0</li>
</ul>

<p>The following code does not deselect the row but the check box is cleared.</p>

<p>For the table option I have</p>

<pre><code>`            select: {
                style: 'os',
                selector: 'td:first-child'
            },`
</code></pre>

<p>On click of the check box</p>

<pre><code>`        $('#invoiceTable tbody').on('click', '.selectPost', function (el) {
            //   var allData = invoiceTable.rows().data();
            let data = invoiceTable.row($(this).closest('tr')).data();
            let index = invoiceTable.row($(this).closest('tr')).index();
            let bank = ltgObj('sale.controlID').val();
            debugger;
            if (bank === '') {
                this.checked = false;
                //   invoiceTable.rows({ selected: true }).deselect();
                invoiceTable.row(index).deselect();
                ltgObj('sale.controlID').addClass('is-invalid');`
</code></pre>

<p>The class is updated and the checkbox is cleared but the row remains selected/highlighted and the footer shows one selected row. tried both rows and row option<br />
Sorry but test case is difficult as no public access.<br />
Thanks.</p>
]]>
        </description>
    </item>
    <item>
        <title>Pagination resets to first page after editing a row with SearchPane filter active</title>
        <link>https://datatables.net/forums/discussion/81348/pagination-resets-to-first-page-after-editing-a-row-with-searchpane-filter-active</link>
        <pubDate>Tue, 09 Sep 2025 13:53:35 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>Edus001</dc:creator>
        <guid isPermaLink="false">81348@/forums/discussions</guid>
        <description><![CDATA[<p>Hello,<br />
I've run into a problem with Editor and SearchPanes. I've noticed that when I have a SearchPane filter selected (so only a subset of rows is showing) and I edit a row, the table redraws as expected but the pagination resets back to page 1. Without any filters, the table always stays on the same page after an edit.<br />
I've tried to create an example showing the problem but I've run into some issues with live.datatables.net, and I'm thinking about the possibility that what I've described is the expected behavior of DataTables.<br />
I'm using a table with data loaded from an Ajax source with client-side processing, and I'm capturing Editor's preSubmit event to update my database when a row is changed.<br />
If this is expected behavior, it there any way to avoid it? I'll try to provide any additional information as needed.<br />
Thanks in advance.</p>
]]>
        </description>
    </item>
    <item>
        <title>the filter option for searchPane doesnt always show.</title>
        <link>https://datatables.net/forums/discussion/81299/the-filter-option-for-searchpane-doesnt-always-show</link>
        <pubDate>Wed, 27 Aug 2025 09:19:23 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>tseonez</dc:creator>
        <guid isPermaLink="false">81299@/forums/discussions</guid>
        <description><![CDATA[<p>Users on the site i am supporting are reporting that the search filter options appear to be blank some times <img src="https://datatables.net/forums/uploads/editor/8w/2spx8avrdw65.png" alt="" title="" />. it is very hard to reproduce but when it happens. users had to refresh few times to see the filter option, do you have any suggestion how i can get that fixed. would disabling stateSave option help?</p>
]]>
        </description>
    </item>
    <item>
        <title>Columns misaligned when width is not 100%</title>
        <link>https://datatables.net/forums/discussion/81295/columns-misaligned-when-width-is-not-100</link>
        <pubDate>Tue, 26 Aug 2025 15:28:31 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>NoBullMan</dc:creator>
        <guid isPermaLink="false">81295@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>:<br />
<strong>Debugger code (debug.datatables.net)</strong>:<br />
<strong>Error messages shown</strong>:<br />
<strong>Description of problem</strong>:<br />
When I set the width of table to 100%, all is well. When I change it to, say, 75% because there are only two or three columns and I don;t need the whole width of the screen, headers and data rows are misaligned.</p>

<p>I tried using tblCountryCodes.column.adjust().responsive.recalc() but didn't make a difference.</p>

<pre><code>&lt;div&gt;
    &lt;table id="countryCodesTable" class="table table-striped table-bordered table-hover display responsive compact" **style="width:75%;"**&gt;
        &lt;thead&gt;
            &lt;tr class="info"&gt;
             &lt;th&gt;Country Code&lt;/th&gt;
             &lt;th&gt;Country Name&lt;/th&gt;
         &lt;/tr&gt;
     &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;script&gt;
    function populateTable() {
        $.ajax({
            type: "POST",
            dataType: "json",
            contentType: "application/json; charset=utf-8",
            url: "Path to WebService API",
            cache: false,
            data: null,
        }).done(function (result) {
            tblCountryCodes.clear().draw();
            if (!result || result.d === "") {
            }
            else {
                jResult = JSON.parse(result.d);
                tblCountryCodes.rows.add(jResult).draw();
                tblCountryCodes.columns.adjust().responsive.recalc();
            }
        }).fail(function (jqXHR, textStatus, errorThrown) {
            //alert(textStatus + ' - ' + errorThrown + '\n' + jqXHR.responseText);
        });
    }

    var tblCountryCodes = $("#countryCodesTable").DataTable({
        ...
        order: [0, 'asc'],
        autoWidth: true,
        paging: false,
        columns: [
            {
                data: "COUNTRY_CODE"
            }, {
                data: "COUNTRY_NAME"
            }
        ],
        pageLength: -1,
        deferRender: true,
    });
&lt;/script&gt;
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>Column Filter Textbox Width</title>
        <link>https://datatables.net/forums/discussion/81290/column-filter-textbox-width</link>
        <pubDate>Mon, 25 Aug 2025 18:25:49 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>NoBullMan</dc:creator>
        <guid isPermaLink="false">81290@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>:<br />
<strong>Debugger code (debug.datatables.net)</strong>:<br />
<strong>Error messages shown</strong>:<br />
<strong>Description of problem</strong>:<br />
It seems textbox used in column filtering is fixed width. Even when I specify custom column width in columnDef, this fixed-size textbox overrides it.</p>

<p>How can I make these textboxes follow column width values?</p>
]]>
        </description>
    </item>
    <item>
        <title>Column Filtering Issue</title>
        <link>https://datatables.net/forums/discussion/81277/column-filtering-issue</link>
        <pubDate>Wed, 20 Aug 2025 13:00:21 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>NoBullMan</dc:creator>
        <guid isPermaLink="false">81277@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>:<br />
<strong>Debugger code (debug.datatables.net)</strong>:<br />
<strong>Error messages shown</strong>:<br />
<strong>Description of problem</strong>:<br />
I am upgrading from 1.10 to 2.3.2 and when I was testing one page that had column filtering, I noticed as soon as I typed a character in the text box, I got an error: "ReferenceError: visible is not defined"., in dataTables.min.js.</p>

<p>When I looked at js file, I noticed error occurred at:</p>

<pre><code>if (o)
    switch (o[2]) {
        case "visIdx":
        case visible:
           return o[1] &amp;&amp; o[1].match(....)
</code></pre>

<p>When I added quotes to <em>visible</em>, error went away.<br />
I reverted the change because I am not 100% sure this is the issue and didn't want to mess with datatable's js file.</p>

<p>Also, I noticed when I click on filter text box, table gets sorted, as if I had clicked on column header itself. Is there a way of preventing this, or because filter is part of header, it just sorts it automatically?</p>
]]>
        </description>
    </item>
    <item>
        <title>Button Placement in DataTable 2</title>
        <link>https://datatables.net/forums/discussion/81274/button-placement-in-datatable-2</link>
        <pubDate>Tue, 19 Aug 2025 12:04:29 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>NoBullMan</dc:creator>
        <guid isPermaLink="false">81274@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>:<br />
<strong>Debugger code (debug.datatables.net)</strong>:<br />
<strong>Error messages shown</strong>:<br />
<strong>Description of problem</strong>:<br />
How do I place export to Excel and export to CSV buttons on top of the table between page length (topLeft) and search (topRight), same row?<br />
I tried topCenter but it seems to take the whole row and pushes page length and search to next row.</p>
]]>
        </description>
    </item>
    <item>
        <title>Multiple header breaks datatable functionality</title>
        <link>https://datatables.net/forums/discussion/81270/multiple-header-breaks-datatable-functionality</link>
        <pubDate>Tue, 19 Aug 2025 04:42:54 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>NoBullMan</dc:creator>
        <guid isPermaLink="false">81270@/forums/discussions</guid>
        <description><![CDATA[<p><strong>Link to test case</strong>:<br />
<strong>Debugger code (debug.datatables.net)</strong>:<br />
<strong>Error messages shown</strong>:<br />
<strong>Description of problem</strong>:<br />
I am in the process of upgrading from 1.10 to 2.3.2. I managed most of the updates but one thing took me a while to sort out and I wanted to check with you.</p>

<p>HTML table has two header rows. The second row's total number of column is larger them total of top row's spanning columns, like below:</p>

<pre><code>&lt;table id="blah" class="..."&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th colspan="2"&gt;Set 1&lt;/th&gt;
            &lt;th colspan="3"&gt;Set 2&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;th&gt;Col 1&lt;/th&gt;
            &lt;th&gt;Col 2&lt;/th&gt;
            &lt;th&gt;Col 3&lt;/th&gt;
            &lt;th&gt;Col 4&lt;/th&gt;
            &lt;th&gt;Col 5&lt;/th&gt;
            &lt;th style=display:none"&gt;Col 6&lt;/th&gt;
        &lt;/tr&gt;
    &lt;thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
    &lt;tfoot&gt;
    &lt;/tfoot&gt;
&lt;table id="blah" class="..."&gt;
</code></pre>

<p>Note that total of spanned columns is 5 and total of single span columns is 6.</p>

<p>This worked fine in 1.10 but broke in 2.3.2, throwing an exception in datatbles.js, in "__column_header = function (settings, column , row), with "TypeError: cannot read properties of undefined (reading 'unique')".<br />
I found out that I had to add another &lt;th&gt; to first row, making it below to make the total number of columns match, or delete the first header row:</p>

<pre><code>&lt;table id="blah" class="..."&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th colspan="2"&gt;Set 1&lt;/th&gt;
            &lt;th colspan="3"&gt;Set 2&lt;/th&gt;
            &lt;th style="display:none"&gt;&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            ...
</code></pre>

<p>Is this the case in data tables 2. that it is less forgiving than 1.10, or am I missing something?</p>
]]>
        </description>
    </item>
    <item>
        <title>Node.JS - Duplicate SQL queries and efficiency improvements on COUNT queries.</title>
        <link>https://datatables.net/forums/discussion/80462/node-js-duplicate-sql-queries-and-efficiency-improvements-on-count-queries</link>
        <pubDate>Thu, 16 Jan 2025 21:17:51 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>MarkAndersonUK</dc:creator>
        <guid isPermaLink="false">80462@/forums/discussions</guid>
        <description><![CDATA[<p>Hi,</p>

<p>I have noticed that when SQL command is executed by the NodeJS backend,   that   3 queries are executed,</p>

<p>1st.    a query to COUNT the total records.   ( 1,448,364  in my example)<br />
2nd.   a query to COUNT the records 'filtered'  (16,788   in my example)<br />
3rd.   the query to obtain the data.</p>

<p>I think this is used to get the counts for the info line:</p>

<blockquote>
  <p>Showing 1 to 23 of 16,788 entries (filtered from 1,448,364 total entries)</p>
</blockquote>

<p>If there are zero filters being applied,  the 1st and 2nd  queries are identical  (however BOTH queries are run).      It would be great if there was someway to eliminate the need to run two identical queries back to back  when no filtering is applied.</p>

<p>I mentioned this before with examples a while back (<a rel="nofollow" href="https://datatables.net/forums/discussion/72018" title="https://datatables.net/forums/discussion/72018"></a><a rel="nofollow" href="https://datatables.net/forums/discussion/72018">https://datatables.net/forums/discussion/72018</a>)   and at that time I thought it was just a plain duplicate query,  now I realize the queries are only duplicated if there are no filtered being applied.</p>

<p>Also,   if you are using a JOIN to get OPTIONS for one or more of the fields,   these JOINS don't impact the COUNT,  but do cause speed issues when work with large tables.</p>

<p>Here is an example of some SQL being run  :</p>

<pre><code>select count(`recruits`.`recruitID`) as `cnt` from `recruits` 
left join `stages` on `stages`.`stageID` = `recruits`.`statusID` 
left join `recruiters` as `rAsst` on `rAsst`.`agentref` = `recruits`.`RecruitmentAsst` 
left join `recruiters` as `recruiter` on `recruiter`.`agentref` = `recruits`.`Recruiter` 
where (`recruits`.`_search_current` &gt; 0);
</code></pre>

<p>This can take 1.5sec to make the roundtrip to the SQL server and back,     but the query below :</p>

<pre><code>select count(`recruits`.`recruitID`) as `cnt` from `recruits` 
where (`recruits`.`_search_current` &gt; 0);
</code></pre>

<p>This gives the same Count,  but  takes 0.2secs .</p>

<p>I understand some JOINS might change the total record count,  but I think there are some situations that you can trust it will not..     Or  perhaps you might consider allowing a configuration switch to allow the designers to set which behavior to use.</p>

<p>Once again,  thanks for your product and thanks for looking at my ramblings.</p>
]]>
        </description>
    </item>
    <item>
        <title>Standalone editor won't call ssp</title>
        <link>https://datatables.net/forums/discussion/81233/standalone-editor-wont-call-ssp</link>
        <pubDate>Wed, 06 Aug 2025 13:23:33 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>Stacey1134</dc:creator>
        <guid isPermaLink="false">81233@/forums/discussions</guid>
        <description><![CDATA[<p>I have a need to edit the data on a table not shown, and for some reason, I cannot get editor to call the ssp script.</p>

<pre><code>    let selectedFacilityID = null;
    const facilityEditor = new $.fn.dataTable.Editor( {
        ajax: {
            url: baseUrl + "modules/database/ssp_facilities.php",
            type: "POST",
            error: function (xhr, error, thrown) {
                console.error('AJAX Error:', error, thrown);
                console.error('XHR:', xhr);
            }
        },
        idSrc: "Facility_ID",
        template: '#facForm',      
        fields: [ {
                name:  "Facility_Type",
                type:  "select",                  
                className: 'full block'                    
            }, {   
            ...
            }

        ]
    } );
</code></pre>

<pre><code>    $('#printerTable tbody').on('click', 'tr', function () {
        var data = ( table.row( this ).data() );
        // The facility ID should come from PrisonFacilityListing, not form.FAC_ID
        selectedFacilityID = data.PrisonFacilityListing.Facility_ID;
        ...
        })
    }
</code></pre>

<pre><code>    $('#editFacilityBtn').on('click', function () {
        if (!selectedFacilityID) {
            alert('No facility selected. Please select a row in the table first.');
            return;
        }
        
        console.log('Selected Facility ID:', selectedFacilityID);
        facilityEditor
            .edit(selectedFacilityID)
            .title('Quick Edit Facility')
            .buttons([
                {
                    label: 'Save',
                    className: 'btn-sm lnk-modal-button',
                    fn: function () {
                        this.submit();
                    }
                }, {
                    label: 'Cancel',
                    className: 'btn-sm lnk-modal-button',
                    fn: function () {
                        this.close();
                    }
                }
            ])
            .open();
    });
</code></pre>

<p>Standalone editor opens fine, template is fine, but no data, when watching the network calls, it never calls ssp_facilities.php<br />
I can do this by hand, but standalone should be able to do this. What do I need to do to initiate the ajax call?</p>

<p>To be clear, selectFacilityID does contain the id, and it is a correct ID as it is visibly showing a proper left join in a different table, the one selected above.</p>
]]>
        </description>
    </item>
    <item>
        <title>angular-datatables archived.  Suggestions?</title>
        <link>https://datatables.net/forums/discussion/81239/angular-datatables-archived-suggestions</link>
        <pubDate>Fri, 08 Aug 2025 00:20:23 +0000</pubDate>
        <category>DataTables 2</category>
        <dc:creator>pbristow</dc:creator>
        <guid isPermaLink="false">81239@/forums/discussions</guid>
        <description><![CDATA[<p>The github project angular-datatables has been archived as of Feb 2025: <a rel="nofollow" href="https://github.com/l-lin/angular-datatables.">https://github.com/l-lin/angular-datatables.</a>  The last release was for Angular v19.  I'm blocked from upgrading to Angular v20 without using npm overrides, which of course I'm hesitant to do on production code.</p>

<p>What have other people done?  Has anyone used DataTables.net on Angular latest without angular-datatables?  If so, do you have sample code, helpful tips, etc?</p>

<p>Does anyone know why angular-datatables was archived?  I can't find anything in the discussion, issues, website, etc.</p>

<p>Thank you.  Very hesitant about what to do next!</p>
]]>
        </description>
    </item>
   </channel>
</rss>
