From df614240cf9bb3f943dd305a33df6572577ff051 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sun, 9 Sep 2012 12:26:57 +0100 Subject: [PATCH] Update: Fully deprecate fnRender - it will be removed from the next major version of DataTables and it is strongly adviced that you do not use it! --- media/js/jquery.dataTables.js | 120 ++++++---------------- media/src/model/model.column.js | 29 +++--- media/src/model/model.defaults.columns.js | 91 +++------------- 3 files changed, 66 insertions(+), 174 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index cbc7b158..5292db69 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -7584,14 +7584,14 @@ "bSortable": null, /** - * When using fnRender, you have two options for what to do with the data, - * and this property serves as the switch. Firstly, you can have the sorting - * and filtering use the rendered value (true - default), or you can have - * the sorting and filtering us the original value (false). - * - * *NOTE* It is it is advisable now to use mData as a function and make - * use of the 'type' that it gives, allowing (potentially) different data to - * be used for sorting, filtering, display and type detection. + * Deprecated When using fnRender, you have two options for what + * to do with the data, and this property serves as the switch. Firstly, you + * can have the sorting and filtering use the rendered value (true - default), + * or you can have the sorting and filtering us the original value (false). + * + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type boolean * @deprecated */ @@ -7614,9 +7614,9 @@ /** * Developer definable function that is called whenever a cell is created (Ajax source, - * etc) or processed for input (DOM source). This can be used as a compliment to fnRender + * etc) or processed for input (DOM source). This can be used as a compliment to mRender * allowing you to modify the DOM element (add background colour for example) when the - * element is available (since it is not when fnRender is called). + * element is available. * @type function * @param {element} nTd The TD node that has been created * @param {*} sData The Data for the cell @@ -7643,8 +7643,12 @@ "fnGetData": null, /** - * Custom display function that will be called for the display of each cell - * in this column. + * Deprecated Custom display function that will be called for the + * display of each cell in this column. + * + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type function * @param {object} o Object with the following parameters: * @param {int} o.iDataRow The row in aoData @@ -7653,6 +7657,7 @@ * @param {object} o.oSettings The settings object for this DataTables instance * @returns {string} The string you which to use in the display * @default null + * @deprecated */ "fnRender": null, @@ -9888,51 +9893,18 @@ /** - * When using fnRender() for a column, you may wish to use the original data - * (before rendering) for sorting and filtering (the default is to used the - * rendered data that the user can see). This may be useful for dates etc. + * Deprecated When using fnRender() for a column, you may wish + * to use the original data (before rendering) for sorting and filtering + * (the default is to used the rendered data that the user can see). This + * may be useful for dates etc. * - * *NOTE* This property is now deprecated, and it is suggested that you use - * mData and / or mRender to render data for the DataTable. + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type boolean * @default true * @dtopt Columns * @deprecated - * - * @example - * // Using aoColumnDefs - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumnDefs": [ - * { - * "fnRender": function ( oObj ) { - * return oObj.aData[0] +' '+ oObj.aData[3]; - * }, - * "bUseRendered": false, - * "aTargets": [ 0 ] - * } - * ] - * } ); - * } ); - * - * @example - * // Using aoColumns - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumns": [ - * { - * "fnRender": function ( oObj ) { - * return oObj.aData[0] +' '+ oObj.aData[3]; - * }, - * "bUseRendered": false - * }, - * null, - * null, - * null, - * null - * ] - * } ); - * } ); */ "bUseRendered": true, @@ -9970,9 +9942,9 @@ /** * Developer definable function that is called whenever a cell is created (Ajax source, - * etc) or processed for input (DOM source). This can be used as a compliment to fnRender + * etc) or processed for input (DOM source). This can be used as a compliment to mRender * allowing you to modify the DOM element (add background colour for example) when the - * element is available (since it is not when fnRender is called). + * element is available. * @type function * @param {element} nTd The TD node that has been created * @param {*} sData The Data for the cell @@ -9999,8 +9971,12 @@ /** - * Custom display function that will be called for the display of each cell in - * this column. + * Deprecated Custom display function that will be called for the + * display of each cell in this column. + * + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type function * @param {object} o Object with the following parameters: * @param {int} o.iDataRow The row in aoData @@ -10011,37 +9987,7 @@ * @param {*} val The current cell value * @returns {string} The string you which to use in the display * @dtopt Columns - * - * @example - * // Using aoColumnDefs - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumnDefs": [ - * { - * "fnRender": function ( o, val ) { - * return o.aData[0] +' '+ o.aData[3]; - * }, - * "aTargets": [ 0 ] - * } - * ] - * } ); - * } ); - * - * @example - * // Using aoColumns - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumns": [ - * { "fnRender": function ( o, val ) { - * return o.aData[0] +' '+ o.aData[3]; - * } }, - * null, - * null, - * null, - * null - * ] - * } ); - * } ); + * @deprecated */ "fnRender": null, diff --git a/media/src/model/model.column.js b/media/src/model/model.column.js index 88ffe22f..db54cc0c 100644 --- a/media/src/model/model.column.js +++ b/media/src/model/model.column.js @@ -48,14 +48,14 @@ DataTable.models.oColumn = { "bSortable": null, /** - * When using fnRender, you have two options for what to do with the data, - * and this property serves as the switch. Firstly, you can have the sorting - * and filtering use the rendered value (true - default), or you can have - * the sorting and filtering us the original value (false). - * - * *NOTE* It is it is advisable now to use mData as a function and make - * use of the 'type' that it gives, allowing (potentially) different data to - * be used for sorting, filtering, display and type detection. + * Deprecated When using fnRender, you have two options for what + * to do with the data, and this property serves as the switch. Firstly, you + * can have the sorting and filtering use the rendered value (true - default), + * or you can have the sorting and filtering us the original value (false). + * + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type boolean * @deprecated */ @@ -78,9 +78,9 @@ DataTable.models.oColumn = { /** * Developer definable function that is called whenever a cell is created (Ajax source, - * etc) or processed for input (DOM source). This can be used as a compliment to fnRender + * etc) or processed for input (DOM source). This can be used as a compliment to mRender * allowing you to modify the DOM element (add background colour for example) when the - * element is available (since it is not when fnRender is called). + * element is available. * @type function * @param {element} nTd The TD node that has been created * @param {*} sData The Data for the cell @@ -107,8 +107,12 @@ DataTable.models.oColumn = { "fnGetData": null, /** - * Custom display function that will be called for the display of each cell - * in this column. + * Deprecated Custom display function that will be called for the + * display of each cell in this column. + * + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type function * @param {object} o Object with the following parameters: * @param {int} o.iDataRow The row in aoData @@ -117,6 +121,7 @@ DataTable.models.oColumn = { * @param {object} o.oSettings The settings object for this DataTables instance * @returns {string} The string you which to use in the display * @default null + * @deprecated */ "fnRender": null, diff --git a/media/src/model/model.defaults.columns.js b/media/src/model/model.defaults.columns.js index d08ab040..9387fe2c 100644 --- a/media/src/model/model.defaults.columns.js +++ b/media/src/model/model.defaults.columns.js @@ -142,51 +142,18 @@ DataTable.defaults.columns = { /** - * When using fnRender() for a column, you may wish to use the original data - * (before rendering) for sorting and filtering (the default is to used the - * rendered data that the user can see). This may be useful for dates etc. + * Deprecated When using fnRender() for a column, you may wish + * to use the original data (before rendering) for sorting and filtering + * (the default is to used the rendered data that the user can see). This + * may be useful for dates etc. * - * *NOTE* This property is now deprecated, and it is suggested that you use - * mData and / or mRender to render data for the DataTable. + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type boolean * @default true * @dtopt Columns * @deprecated - * - * @example - * // Using aoColumnDefs - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumnDefs": [ - * { - * "fnRender": function ( oObj ) { - * return oObj.aData[0] +' '+ oObj.aData[3]; - * }, - * "bUseRendered": false, - * "aTargets": [ 0 ] - * } - * ] - * } ); - * } ); - * - * @example - * // Using aoColumns - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumns": [ - * { - * "fnRender": function ( oObj ) { - * return oObj.aData[0] +' '+ oObj.aData[3]; - * }, - * "bUseRendered": false - * }, - * null, - * null, - * null, - * null - * ] - * } ); - * } ); */ "bUseRendered": true, @@ -224,9 +191,9 @@ DataTable.defaults.columns = { /** * Developer definable function that is called whenever a cell is created (Ajax source, - * etc) or processed for input (DOM source). This can be used as a compliment to fnRender + * etc) or processed for input (DOM source). This can be used as a compliment to mRender * allowing you to modify the DOM element (add background colour for example) when the - * element is available (since it is not when fnRender is called). + * element is available. * @type function * @param {element} nTd The TD node that has been created * @param {*} sData The Data for the cell @@ -253,8 +220,12 @@ DataTable.defaults.columns = { /** - * Custom display function that will be called for the display of each cell in - * this column. + * Deprecated Custom display function that will be called for the + * display of each cell in this column. + * + * Please note that this option has now been deprecated and will be removed + * in the next version of DataTables. Please use mRender / mData rather than + * fnRender. * @type function * @param {object} o Object with the following parameters: * @param {int} o.iDataRow The row in aoData @@ -265,37 +236,7 @@ DataTable.defaults.columns = { * @param {*} val The current cell value * @returns {string} The string you which to use in the display * @dtopt Columns - * - * @example - * // Using aoColumnDefs - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumnDefs": [ - * { - * "fnRender": function ( o, val ) { - * return o.aData[0] +' '+ o.aData[3]; - * }, - * "aTargets": [ 0 ] - * } - * ] - * } ); - * } ); - * - * @example - * // Using aoColumns - * $(document).ready( function() { - * $('#example').dataTable( { - * "aoColumns": [ - * { "fnRender": function ( o, val ) { - * return o.aData[0] +' '+ o.aData[3]; - * } }, - * null, - * null, - * null, - * null - * ] - * } ); - * } ); + * @deprecated */ "fnRender": null,