Calculable fields or sql functions - part2

Calculable fields or sql functions - part2

netenjoynetenjoy Posts: 4Questions: 2Answers: 0

After 4years is there a better way to handle this?

https://datatables.net/forums/discussion/comment/85241/#Comment_85241

is there a way to avoid creating a "placeholder" column in the database (that will be fully replaced by the getFormatter)?

Answers

  • netenjoynetenjoy Posts: 4Questions: 2Answers: 0

    (using getFormatter there is also the issue that the "calulated column" cannot be ordered, as the real data are nulls)

  • allanallan Posts: 50,047Questions: 1Answers: 7,403 Site admin

    From the original thread:

    Is it not possible to create a field instance over an unexisting table column with the sole purpose to have the formatter return other values?

    Is this the basis of what you are looking for?

    Yes that is possible using getValue() to set the value to get (it has a value, thus it won't be read from the db) and then use getFormatter() if you want to perform a calculation to get a value. You could just use an empty string for getValue() if you don't care what the initial value is.

    Allan

Sign In or Register to comment.