question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sorting on empty fields is wonky and unpredictable

See original GitHub issue

I took a screen capture of what’s going on. I click on sort on columns with empty fields and the sort is really unpredictable. I can’t really tell what it’s doing.

https://drive.google.com/file/d/0B0jVs-9rYRN8Y3c0eTFDUGU0eUE/view?usp=sharing

<BootstrapTable 
   printable
   bodyStyle={{overflow: 'overlay', maxHeight: height}}
   ref='table' 
   data={ this.state.rows } 
   striped={ true } 
   hover={ true } 
   search={ true }
   searchPlaceholder="Search..."
   scrollTop={ 'Top' }
   keyField='timestamp'
   options={ options }
   exportCSV={ true }
   csvFileName="alerts"
>
   { headers }
</BootstrapTable>

And this is my headers code:

return columns.map((header, id) => {
   if (header === "__health") {
      return (
         <TableHeaderColumn key={ id } dataField={ header } hidden={ true }>{ header.toUpperCase() }</TableHeaderColumn>
      )
   } else if (header.toLowerCase() === "timestamp") {
      return (
         <TableHeaderColumn key={ id } dataField={ header } dataSort={ true } dataFormat={ this._dateFormatter }>{ header.toUpperCase() }</TableHeaderColumn>
      )
   } else {
      return (
         <TableHeaderColumn key={ id } dataField={ header } dataSort={ true } dataFormat={ this._statusStyler }>{ header.toUpperCase() }</TableHeaderColumn>
      )
   }
});

Any ideas? I would think empty td’s would sort to one end of my table on ASC sort, then the other end on DESC sort.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
stevelacerda7commented, Sep 22, 2017

Unfortunately, our build process automatically pulls directly from npm, so anything in the package.json file will be pulled from remote repo. Instead, I just imported react-bootstrap-table.js.min into my component, not great, but works for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sorting when having empty cells - Microsoft Community
I am trying to sort an Excel file starting with the first column which has the dates and I selected expand the selection....
Read more >
How to sort empty field in reports ? - ServiceNow Community
I got report where data are sort ASCENDING by date. Field DATE can be EMPTY. And here is the main problem... First are...
Read more >
Sorting Through Belongings After a Death - Whats your Grief
Sorting through a loved one's belongings after a death is never an easy task. In this article we offer practical advice for preparation...
Read more >
linux - Unexpected result while sorting the csv file
I have the following CSV file as shown below with 4 columns, and I am taking input of filename from bash terminal. Sile,Barhams,Female,sba3@exe....
Read more >
Sort data - Stata
sort arranges the observations of the current data into ascending order based on the values of the variables in varlist.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found