INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

JQuery DataTables Plugin Error

JQuery DataTables Plugin Error

(OP)
I don't understand why DataTables is throwing this error in FF

Quote:

TypeError: e[j] is undefined

In IE it's reported as

Quote:

Unable to get property 'aDataSort' of undefined or null reference

Here is the code

HTML

CODE

<table id="fp_promotion_history">
	<thead>
		<tr>
			<th>AuditID</th>
			<th>Action</th>
			<th>Description</th>
			<th>User Name</th>
			<th>Audit Date</th>
		</tr>
	</thead>
	<tbody>
	    <tmpl_loop name='fp_history'>
    		<tr id="AuditID_<tmpl_var name='AuditID'>">
                <td data-AuditID="<tmpl_var name='AuditID'>"><tmpl_var name='AuditID'></td>  
                <td data-Action="<tmpl_var name='Action'>"><tmpl_var name='Action'></td>
    			<td data-Audit_Desc="<tmpl_var name='Audit_Desc'>"><tmpl_var name='Audit_Desc'></td>
    			<td data-User_Name="<tmpl_var name='User_Name'>"><tmpl_var name='User_Name'></td>    			
    			<td data-Audit_Date="<tmpl_var name='Audit_Date'>"><tmpl_var name='Audit_Date'></td>
    		</tr>
		</tmpl_loop>
	</tbody>
    </table> 
JQuery

CODE

showDialog({content:data,title:'Financial Promotion Audit Trail History (FPID : ' + $('#fp_promotions_table tr.selected').attr('id') + ')'});                                            
            
            // turn into a datatable
            $('#fp_promotion_history').dataTable({        
                    "sDom": 'R<"H"fr>t<"F"ip>',            
            	    "bJQueryUI": true,
            		"sPaginationType": "full_numbers",
            		"iDisplayLength": 25,
            		"order": [[ 5, "desc" ]]
            }); 
What I don't understand is I already have a datatable on the page which is working fine.

I make an AJAX call, display the result (a table) with the JQuery UI Dialog, but when I try to turn it into a DataTable , it just errors?

The documentation implies multiple tables is OK : http://legacy.datatables.net/release-datatables/ex...

So what am I doing wrong?

Thanks,
1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: JQuery DataTables Plugin Error

(OP)
It believe it was due to the order parameter

CODE

"order": [[ 5, "desc" ]] 

It would seem the column ordering is ZERO based, which isn't that clear from the docs : https://datatables.net/reference/api/order()

It keeps mentioning Column 1 as [1] not [0].

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close