Unable to use TableTools plugin & not able to reinitialize the DataTables object

Unable to use TableTools plugin & not able to reinitialize the DataTables object

sachin_kakkar83sachin_kakkar83 Posts: 5Questions: 0Answers: 0
edited March 2012 in TableTools
I am new to Table Tools plugin. I want to use this plugin in my project. Have already used Datatables with success. Would be great if someone can help me out with the below 2 issues:
1. When I use DataTables, the data is fetched from the server and a table is displayed on the web page. But after changing my input query, the previous table is only getting displayed. I am not able to figure out how to destroy the previous table object and create a new one. Have gone through few "Discussions " but no success. Can someone please help me out with that ? Pasted the code below
2. Not able to use TableTools in my code.Please refer to the below code. The below jsp is making use of data tables. I tried using Table Tools but no icon is getting visible. Can you please tell me what am I missing ?

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



Insert title here











function ajaxFunction() {

document.getElementById('demo_jui').style.display='';
$(document).ready(function () {

var empname = document.getElementById("empname");
var defecttype = document.getElementById("defecttype");
var project = document.getElementById("project");


$("#companies").dataTable({
"bServerSide": true,
"sAjaxSource": "/JQueryDataTables/CompanyAjaxDataSource?empname="+empname.value+"&defecttype="+defecttype.value+"&project="+project.value,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true



});

});
}







Enter Details



Employee's Name
ABC


Defect Type
FST

AT
Regression
ASM



Project
UC-1202



  











DefectId
EmployeeId
Severity
Defect Type
Project
Original Owner
Coded By
Root Cause
Defect Category
Efforts

Replies

  • sachin_kakkar83sachin_kakkar83 Posts: 5Questions: 0Answers: 0
    This is really wierd. I didnt use fnClearTable() or fnDraw() function to reinitailize the datatable. Just removed a null check in my servlet class. And, the datatable started getting re initialized everytime I passed new input values to servlet. Now, the only issue which remains is that I want to use TableTools plugin for the Export to CSV functionality. Can someone help me in changing the above jsp code to integrate the TableTools plugin ???????????
  • sachin_kakkar83sachin_kakkar83 Posts: 5Questions: 0Answers: 0
    There is one more issue. Everytime I click on the "Submit" button (mentioned in above jsp), the size of resultant table changes. The width of the resultant table changes everytime the "Submit" button is clicked. How to stop that ?
This discussion has been closed.