mdata and mrender with conditional return

mdata and mrender with conditional return

muhammadmahdimuhammadmahdi Posts: 2Questions: 1Answers: 0

Hello, i'm new here and also new with datatables, i have some question regarding mdata and mrender :

  1. i have a scenario that my datatables have 3 columns, 2 of them retrieved from database, the last one is custom (i want to put approval button in here), i manage to used the mdata null and mrender return html button for this one but the approval button always appear whether the items or data already approve, my question is if i want to check if the items or the data already approved (from the database) then i want to put edit button instead of approval button, or i don't have to put button at all because that item or data already approve, how to do that ?

  2. i don't know how to modified server-side script query to display conditional query, ex: if a user A login, the query for him would be SELECT * FROM ajax WHERE grade='A', but if user B login, the query would be default query (i'm using datatables server-side example script in http://www.datatables.net/development/server-side/php_postgres), how to do that?

Sorry for my noob question, it's been only for few days using datatables, Thank You. :)

Answers

This discussion has been closed.