Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

KTDataTable v9.1.1 Hotfixes

Here are two hotfixes for the recent Datatable issue:

  1. Persist Search Input Value After Page Refresh In the /src/core/components/datatable/datatable.ts file, modify the _attachSearchEvent function.

Add the following lines after the searchElement declaration:

const searchElement: HTMLInputElement | null = document.querySelector(`[data-datatable-search="#${tableId}"]`);

// Get search state
const { search } = this.getState();

// Set search value
searchElement.value = typeof search === 'string' ? search : String(search);

This will fix the search input retains its value after refreshing the page.

  1. Display Error Message When Search Yields No Results In the same file (datatable.ts), update the _noticeOnTable function.

Find this line:

const row = this._tbodyElement.insertRow();

Replace it with:

const row = this._tableElement.tBodies[0].insertRow();

This modification addresses the issue where the "infoEmpty" message does not display when the search is empty, so the message appears correctly.

These tweaks should help resolve the issues.

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (0)