Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions jsx/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class DataTable extends Component {
/**
* Set the component page variable
* to a new value
*
* @param {number} i - Page index
*/
changePage(i) {
Expand All @@ -55,7 +54,6 @@ class DataTable extends Component {
* Update the sort column
* If component sort.column is already set to column
* Toggle sort.ascending
*
* @param {number} column - The column index
*/
setSortColumn(column) {
Expand All @@ -68,7 +66,6 @@ class DataTable extends Component {

/**
* Update the sort column
*
* @param {number} column - The column index
*/
updateSortColumn(column) {
Expand All @@ -88,7 +85,6 @@ class DataTable extends Component {

/**
* Updates page state
*
* @param {number} number - Number of page
*/
updatePageNumber(number) {
Expand All @@ -99,7 +95,6 @@ class DataTable extends Component {

/**
* Update number of rows per page
*
* @param {object} e - Event from which to abstract value
*/
updatePageRows(e) {
Expand All @@ -111,7 +106,6 @@ class DataTable extends Component {

/**
* Export the filtered rows and columns into a csv
*
* @param {number[]} filteredRowIndexes - The filtered Row Indexes
*/

Expand Down Expand Up @@ -215,7 +209,6 @@ class DataTable extends Component {

/**
* Sort the given rows according to the sort configuration
*
* @param {number[]} rowIndexes - The row indexes
* @return {object[]}
*/
Expand Down Expand Up @@ -303,7 +296,6 @@ class DataTable extends Component {
* Searches for the filter keyword in the column cell
*
* Note: Search is case-insensitive.
*
* @param {string} name field name
* @param {string} data search string
* @return {boolean} true, if filter value is found to be a substring
Expand Down Expand Up @@ -354,7 +346,9 @@ class DataTable extends Component {
}
break;
default:
searchString = data ? data.toString().toLowerCase() : '';
searchString = (data !== null && data !== undefined) ?
data.toString().toLowerCase() : '';

if (exactMatch) {
result = (searchString === searchKey);
} else if (opposite) {
Expand All @@ -376,7 +370,8 @@ class DataTable extends Component {
let match = false;
for (let i = 0; i < filterData.length; i += 1) {
searchKey = filterData[i].toLowerCase();
searchString = data ? data.toString().toLowerCase() : '';
searchString = (data !== null && data !== undefined) ?
data.toString().toLowerCase() : '';

let searchArray = searchString.split(',');
match = (searchArray.includes(searchKey));
Expand All @@ -400,7 +395,6 @@ class DataTable extends Component {

/**
* Renders the Actions buttons.
*
* @return {string[]|void} - Array of React Elements
*/
renderActions() {
Expand All @@ -421,7 +415,6 @@ class DataTable extends Component {

/**
* Renders the React component.
*
* @return {JSX} - React markup for the component
*/
render() {
Expand Down
Loading