appendCellHtml ignores numeric value
See original GitHub issueIssue Description
There was a feature added in appendCellHtml
- supporting complex formatters results (formatterResult
). When it returns an object instead of string. Nice but it breaks existing code when formatter returns simple non-string value, i.e. number or Date. In this case the value is just ignored.
Current code:
var formatterResult = getFormatter(row, m)(row, cell, value, m, item);
...
// if there is a corresponding row (if not, this is the Add New row or this data hasn't been loaded yet)
if (item) {
stringArray.push(typeof formatterResult === 'string' ? formatterResult : formatterResult.text);
}
if formatterResult
is a Number then nothing happens.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Incorrect integer value: '' for column 'id' at row 1 - Stack Overflow
The first column is the 'id' column, since its an auto_increment field, I left it blank. For some reason, I am unable to...
Read more >Tables in HTML documents
This attribute, whose value must be an integer > 0, specifies the number of columns "spanned" by the COL element; the COL element...
Read more >MySQL 8.0 Reference Manual :: 13.2.7 INSERT Statement
For the FLOAT and DECIMAL columns, the string-to-number conversion considers the entire string a valid numeric value. An expression expr can refer to...
Read more ><tbody>: The Table Body element - HTML - MDN Web Docs
This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char ......
Read more >Insert standard missing values - MATLAB standardizeMissing
This MATLAB function replaces values specified in indicator with standard missing ... data only and ignores NaT and NaN values in the vector...
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 Free
Top 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
OK, you’ve convinced me. It’s in the spec, and my suggestion doesn’t cover a Date. Also tweaked the other typeofs, that makes sense.
This has been committed and referenced to this issue. Happy to take pull requests!
Ok, in this case it will work. But in general
Object.prototype.toString
is pretty common approach (v === Object(v)
is another), see https://javascriptweblog.wordpress.com/2011/08/08/fixing-the-javascript-typeof-operator/ for details.Also I noticed there’re other checks with
typeof
forselectable
andfocusable
. It’s better to check for!== undefined
, any value means it’s specified, then convert it to a boolean: insteaddo