Create new column in table based on database values pulled
Create new column in table based on database values pulled
Ugh, I am sick of searching this forum and reading a number of articles that don't seem to get me anywhere, so I'm posting this in need of some help.
I am very new to DataTables, so if you have an answer to my question, please explain this to me in as laymen terms as possible.
I am looking to create a new column in my table based on a date value pulled from the datebase and compare it to the current date/time, and if it past the current/date time (or expired) then I want the value of this new column to state that YES it is expired or NO it is not.
Problem is, I have NO idea how to add another column to my table that DOESN'T actually relate to a field in my database table.
I read in the server connection file that you can "use a space where you want to insert a non-database field (for example a counter or static image)", but every time I try and do this, I get a error stating that JSON data from the server could not be parsed.
I know this is probably due to the lack of some type of function I need to have but I am uncertain as to what it is I should be using here...
Please help! :)
I am very new to DataTables, so if you have an answer to my question, please explain this to me in as laymen terms as possible.
I am looking to create a new column in my table based on a date value pulled from the datebase and compare it to the current date/time, and if it past the current/date time (or expired) then I want the value of this new column to state that YES it is expired or NO it is not.
Problem is, I have NO idea how to add another column to my table that DOESN'T actually relate to a field in my database table.
I read in the server connection file that you can "use a space where you want to insert a non-database field (for example a counter or static image)", but every time I try and do this, I get a error stating that JSON data from the server could not be parsed.
I know this is probably due to the lack of some type of function I need to have but I am uncertain as to what it is I should be using here...
Please help! :)
This discussion has been closed.
Replies
Basically, because I kept getting issues trying to use a space in my $aColumns = array, I ended up using a second call to an existing table, and then used an "fnRender": function to format this output to what I wanted (using variables passed from other columns to calculate my message that I wanted to display in this new column).
Thanks.