Can i add multiple column from db at one table?
Can i add multiple column from db at one table?
uTrx
Posts: 24Questions: 6Answers: 0
I have some users fetching from db and shown on datatables. So far so good, every user have their name on db column called first_name. What i am asking, can i do anything to write user and first_name in one table column <th> for example
101 -> Username
Answers
Yes. Depending on when / where you are getting the user's name you can use
columns.title
or jQuery to set theth
. You can use the jQuery statement ininitComplete
.Kevin
I get first name from another db like this.
Laravel Controller
How can i use one of this options to make what i am looking for. Can you do an example with my code?
Here is an example:
http://live.datatables.net/savecude/1/edit
The
initComplete
function passes in the JSON from the Ajax response. You can get the name from one of the rows or you can add an additional object to the response with the data you want.Kevin
But how can i return 2 variable on json data. For now i am using this method but i can return just one variable with this
And i have do return and
$aName
I don't know Laravel very well I'm afraid, so I suspect that you'll need to ask in a Laravel forum or Stackoverflow, but it looks to me like your JSON should contain both
full_name
anduser
properties from the above.Can you use the debugger to give me a trace please - click the Upload button and then let me know what the debug code is.
Thanks,
Allan