(options)
| 415 | } |
| 416 | |
| 417 | function 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 | |
| 447 | function DateCell(options) { |
| 448 | return _.defaults(options, { |
no outgoing calls
no test coverage detected