Documentation
HTML Table Filter Generator is no longer maintained, it is now replaced by the TableFilter project. Don't hesitate to check the demos out in their new location along with exhaustive documentation in the project's WIKI.
Utility Functions
Method | Description | Remarks | Example |
---|---|---|---|
setFilterGrid(id, refRowIndex, configObj) | generates the column filters grid and returns the TF object:
|
var tf = setFilterGrid('myTableId', 2, {col_0: 'select'}); |
|
tf_Id(id) | this is a
|
var myElm = tf_Id('myId'); |
|
tf_Tag(o,tagname) | this is just a
It returns an array |
var myTables = tf_Tag(document, 'table'); |
|
tf_GetNodeText(n) | returns the text of given a node and its child nodes:
|
var tableText = tf_GetNodeText( tf_Tag(document,'table' )[0]); |
|
tf_CreateElm(tag) | creates an html element with defined attributes:
|
var myInput = tf_CreateElm( 'input', ['id','myId'], ['value','Hello
world'] ); |
|
tf_CreateText(t) | this is just a
|
var myText = tf_CreateText( 'Hello world' ); |
|
tf_CreateOpt(text, value ,isSel) | creates an option element and returns it:
|
var myOption = tf_CreateOpt('Value 01', '01', false); |
|
tf_RegexpEscape(s) | escapes special characters:
|
alert( tf_RegexpEscape( '^$[Hello world!\]' ) ); |
|
tf_IsArray(obj) | checks if passed param is an array:
It returns a boolean |
alert(tf_IsArray([1,2,3])); |
|
tf_IsObj(varname) | checks if var exists and is an object:
It returns a boolean |
alert(tf_IsObj('myVar')); |
|
tf_IsFn(fn) | checks if passed param is a function:
It returns a boolean |
alert(tf_IsFn(function(){ var a=0; })); |
|
tf_isValidDate(dateStr, format) | checks if passed date string has a valid date format:
It returns a boolean |
alert( tf_isValidDate('21-7-09', 'DMY') ); |
|
tf_formatDate(dateStr, format) | returns a date object for a given date string and format:
|
var myDate = tf_formatDate('21-7-09', 'YMD'); |
|
tf_removeNbFormat(data, format) | cleans a formated number and returns it:
It returns a number |
alert( tf_removeNbFormat('1.253,77', 'eu') ); |