Treating a column as String in AutoFill
Treating a column as String in AutoFill
AutoFill seems to detect a column as numeric if it matches the pattern in fnPrep. I've tried sType as a definition of aoColumnDefs and using fnStep override. FnStep override does not work for large numbers as its converted to an exponent number. Is there a work-around for this?
This discussion has been closed.
Replies
the value of sType is available from [code] this.s.dt.aoColumns[iColumn].sType [/code]
Thanks
-ADM
The way I went about it is by changing the _fnPrep function (AutoFill.js):
[code]
...
"_fnPrep": function ( sStr)
{
var aMatch = sStr.match(/[\d\.]+/g);
if ( !aMatch || aMatch.length === 0 ) {
...
[/code]
became
[code]
...
"_fnPrep": function ( sStr, colType)
{
var aMatch = sStr.match(/[\d\.]+/g);
if ( !aMatch || aMatch.length === 0 || colType === 'string' || colType === 'html')
[/code]
And for the call to the function
[code]
var oPrepped = this._fnPrep( sStart, this.s.dt.aoColumns[iColumn].sType)
[/code]