MCPcopy
hub / github.com/openstf/stf / NumberCell

Function NumberCell

res/app/device-list/column/device-column-service.js:417–445  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

415}
416
417function NumberCell(options) {
418 return _.defaults(options, {
419 title: options.title
420 , defaultOrder: 'asc'
421 , build: function() {
422 var td = document.createElement('td')
423 td.appendChild(document.createTextNode(''))
424 return td
425 }
426 , update: function(td, item) {
427 var t = td.firstChild
428 t.nodeValue = options.format(options.value(item))
429 return td
430 }
431 , compare: function(a, b) {
432 var va = options.value(a) || 0
433 var vb = options.value(b) || 0
434 return va - vb
435 }
436 , filter: (function() {
437 return function(item, filter) {
438 return filterOps[filter.op || '='](
439 options.value(item)
440 , Number(filter.query)
441 )
442 }
443 })()
444 })
445}
446
447function DateCell(options) {
448 return _.defaults(options, {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected