user525146
user525146

Reputation: 3998

Modify DataTables warning: JSON data from server

I have two question on Datatables plugin. 1. When ever I have something wrong with the database I get this error on my page which doesnt seem to be a friendly error. I want to modify it to custom error display when there is a problem from the database or due to expired session. Can I know how do I modify that on my client side using javascript or something. 2. I need to make all the rows in a column or multiple columns to be a hyperlink so that if I click on that link I have some details.

I really appreciate the help from experts.

Upvotes: 0

Views: 3856

Answers (2)

kgr
kgr

Reputation: 9948

For question one - you may ask DataTables to throw an exception rather than display an alert. Then you could catch it and handle gracefully,

$.fn.dataTableExt.sErrMode = 'throw';

for expanation, see:

http://www.datatables.net/forums/discussion/8763/disable-error-reporting/p1

Upvotes: 1

sarutobi
sarutobi

Reputation: 26

Datatables allow you three ways to solve question 2

  1. Modify sever side to get hyperlinks
  2. Use fnRender function to build hyperlink on-the fly
  3. Use mDataProp as function to build hyperlink only in view

Difference between 2 and 3 is in the last case you will get a powerful tool to modify data by your needs

Upvotes: 1

Related Questions