qyqx / j-table

Automatically exported from code.google.com/p/j-table
0 stars 0 forks source link

add new datatypes #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
* date
* currency

Original issue reported on code.google.com by chris.f....@gmail.com on 10 Jul 2008 at 6:56

GoogleCodeExporter commented 8 years ago

Original comment by chris.f....@gmail.com on 13 Jul 2008 at 6:02

GoogleCodeExporter commented 8 years ago
* allow for styles based on datatypes (e.g. numbers align to right)
* cache datatypes until cells are edited / created / deleted
* perhaps use <th data-datatype="number">

Original comment by chris.f....@gmail.com on 20 Jul 2008 at 10:47

GoogleCodeExporter commented 8 years ago
* yes, store as data-datatype attribute.
* create getDataType() function that serves the attribute if present, and if not
calls an internal recalculation function calculateDataType().
* call calculateDataType() whenever a cell is edited or deleted (no need when 
added,
because it will be blank)

Original comment by chris.f....@gmail.com on 21 Jul 2008 at 6:59

GoogleCodeExporter commented 8 years ago
right, two complications
1 currency is a sub-type of number. Only the user can indicate which is which.
Therefore, we need a user interface for setting datatypes, and a function 
setDataType()

2 regular expressions can't match dates. We need javascript functions too. 
Suggest
adding a function into each object in the dataTypes array as an alternative to 
the
regular expression, e.g. {dataType: "date", test: function(x) {return 
isDate(x);}
//note the missing re: member}

Original comment by chris.f....@gmail.com on 21 Jul 2008 at 9:13

GoogleCodeExporter commented 8 years ago

Original comment by chris.f....@gmail.com on 26 Jul 2008 at 11:11