Sorting on empty fields is wonky and unpredictable
See original GitHub issueI 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:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
https://github.com/AllenFang/react-bootstrap-table/pull/1644