DataTables warning .Requested unknown parameter '0' from the data source for row 0

DataTables warning .Requested unknown parameter '0' from the data source for row 0

nvrulznvrulz Posts: 3Questions: 0Answers: 0
edited June 2013 in General
Hi all,
My apologies if i am asking the same question again in this forum.I am new to Jquery Scripting Language.I am working with Jquery in struts framework. I have developed a JSP ,which uses the datatables .Following is the code snippet of the JSP

[code]


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



Insert title here



@import "js/demo_table.css";

$(document).ready( function () {

$("#table_id").dataTable({ "aoColumns": [ null, null ,null ] });

$('#submitdetail').click(addrow);

} );

function addrow() {

$('#table_id').dataTable().fnAddData( [
$('#empId').val(),
$('#fName').val(),
$('#lName').val(),

] );

}






EMPID:


First name:


Last name:






EMP ID First Name Last Name






[/code]

In this JSP all i want to do ,as of now ,is to add the entries from textboxes to the table.But when i deploy the JSP i get the following error
" DataTables warning (table id="table_id").Requested unknown parameter '0' from the data source for row 0 "

After this error the rows are getting added to the table, but the added rows are not visible i.e the number of rows value below the table gets incremented by 1 but the rows are not visible.

I referred many posts on this forum and used some of their solutions but its not working.

Can anyone please suggest me where im going wrong in this code? Thank you in advance.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Please see http://datatables.net/faqs#unknown_parameter and http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    Link to a test page or a debugger trace :-)

    Allan
  • nvrulznvrulz Posts: 3Questions: 0Answers: 0
    edited June 2013
    HI Allan Thanks for the response.Following is my debugger trace http://debug.datatables.net/odekoj
This discussion has been closed.