Search
43567 results 7271-7280
Forum
- 31st Aug 2013jQuery UI themed table with FixedColumns fixed column cannot sort problemform this demo "http://datatables.net/release-datatables/extras/FixedColumns/themed.html" when themed with jQuery UI then fixed column why cannot sort the first column that Fixed?
- 27th Aug 2013Getting exception while wrapping Data object into json object in a servlet for data tableHi Alan, I am working with datatables first time. I am making an json object in a servlet by calling methods to get object data and then bind it with json data. But I am getting below exception while executing: WARNING: executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@fb6dbd) threw exception java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter? I am using JSF in jsp files. Data is coming very well from data object but could not bind into json object. My code snippets: Script for datatable: function getTable() { $(document).ready(function() { $('#example').dataTable({ 'bProcessing': true, 'bServerSide': true, 'bRetrieve' : true, 'sAjaxSource': './AddNewUserTestServlet', 'bJQueryUI': true, 'aoColumns': [ { 'mData': 'firstName' }, { 'mData': 'lastName' }, { 'mData': 'email' }, { 'mData': 'subscriptionType' } ] }); } ); } function clearTable() { $('#example').dataTable().fnClearTable(); } Servlet: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package beans; import com.google.gson.*; import datatableobject.DataTableObject; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import dbmapping.UsersTbl; import dbopr.DBInformation; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.faces.context.FacesContext; public class AddNewUserTestServlet extends HttpServlet { /** * Processes requests for both HTTP * GET and * POST methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); PrintWriter out = response.getWriter(); AddNewUser newUser=new AddNewUser(); //newUser.getCompanyName(); //Code for getting userlist according to company //List userList = null; List userList = new ArrayList(); //Getting company name from AddNewUserTest String companyName="GridAllDeveloper/pune/India"; //Search method of AddNewUser.java Integer companyId=null; //userList.clear(); DBInformation dBInformation = new DBInformation(); int userId = 0, userType = 0; if (FacesContext.getCurrentInstance().getExternalContext().getSessionMap() != null) { userId = (Integer) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("userId"); userType = (Integer) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("userType"); } if (companyName != null) { companyId = dBInformation.getCompanyId(companyName); if (companyId != null) { userList = dBInformation.getAllUsersByUserIdNCompanyId(userId, companyId); } } dBInformation = null; DataTableObject dataTableObject = new DataTableObject(); dataTableObject.setUserList(userList); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(dataTableObject); out.print(json); //processRequest(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); //processRequest(request, response); } private void processRequest(HttpServletRequest request, HttpServletResponse response) { throw new UnsupportedOperationException("Not yet implemented"); } } Kindly help me. Regards, Arun Singh
- 23rd Aug 2013Possible to target specific element in table cell?I'm trying out DataTables with server-side processing. It looks like DataTables replaces the entire cell with the received data. Is it possible to target specific elements or attributes inside each cell? This is what the page normally looks like: http://tl.toofz.com/Quotes/List (http://debug.datatables.net/ukijor). This is what it looks like after I enable server-side processing: http://tl.toofz.com/Quotes/Quote/ListDT (http://debug.datatables.net/acabiy). Here's a sample JSON output: [code]{ "aaData":[ [ "Leonard", "This is an incredibly quotable quote.", "8" ], [ "Marsilio", "A sturdy lad ... who teams it, farms it ... and always like a cat falls on his feet, is worth a hundred of these city dolls.", "7" ], [ "Hermann", "If you hate someone, you hate something in him that is part of yourself. What isn't part of ourselves doesn't disturb us.", "6" ], [ "Alphonse", "Every man has three characters: That which he exhibits, that which he has, and that which he thinks he has.", "5" ], [ "Elmo", "You generally hear that what a man doesn't know doesn't hurt him, but in business what a man doesn't know does hurt.", "3" ] ], "iTotalDisplayRecords":8, "iTotalRecords":8, "sColumns":null, "sEcho":"1" }[/code]
- 7th Aug 2013Multiple table controls (sDom) and table tools buttonsHello, I am trying to enable multiple controls (header and footer same) with export buttons. If controls are only in footer buttons are working fine. See http://bambous.cz/DataTables/jb2.html When I enable controls for header as well [code]"sDom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>'[/code] buttons will disappear. See http://bambous.cz/DataTables/jb2-1.html Please advice. Thanks. Kvjetoslav
- 12th Jul 2013Error Using Table ToolsHello, I am trying to implement TableTools and keep getting this jQuery error: "Type Issue 'undefined' is not an object (evaluating '$.extend') Issue (Image) can be seen here: http://kulersolutions.com/ls_images/error.png Any ideas?
- 12th Jul 2013sScrollX and table td borders causes horizontal scroll bar to always be visibleFirst of all, awesome plugin. I can't believe how flexible DataTables is! Now for my problem: When using sSrollX, when I apply a solid 1px border so I can more clearly see the cells in a datatable, the horizontal scroll bar always appears (and it is slightly scrollable) even in cases when it shouldn't be there. As soon as I remove the border, the horizontal scroll bar disappears. Is there any way I can fix this? Thanks in advance!
- 12th Jun 2013Data table + knockout integration working issueHi every one i am working on a project where i had to integrate knockout and datatables and i had to achieve CRUD operations using them... I have used knockout-datatables.js downloaded from this source https://github.com/CogShift/Knockout.Extensions my application is working properly but while iam performing rowlevel remove /edit..... which is similar to this example ( http://jsfiddle.net/ducka/haq2y/ ) the rowlevel event (example remove) will work only once... next if i have to make it work i have to either sort or use pagination i am not understanding why is it happening so ....can some one please help me Thank you :)
- 10th Jun 2013Table not displaying French characters properlyI am getting the following problem If one of the columns contains french characters it displays it like this -> Jan� Doe
- 9th Jun 2013dataTables_empty css has no effect to the tableHi, For some reasons it has no effect to the "No matching records found" message even I modified the demo_table.css: .dataTables_empty { color: red; padding-left: 400px; } I found this post, but I am not sure if I edited the wrong spot. http://datatables.net/forums/discussion/7417/customize-no-matching-records-found-message-on-tables/p1 I tried to replace my demo.css to "jquery.dataTables.css" and it doesn't do anything too. table.dataTable td.dataTables_empty { color: red; text-align: right; } It is not like it doesn't work at all. It works if I modified the: "table.dataTable thead th", ".paging_full_numbers a.paginate_active", "table.dataTable tr.even" Has someone experience this issue before? Thanks.
- 30th May 2013Table Resizing and Google InfoWindowHi, I have searched high and low for an answer to my question but wasn't able to get a resolution to my question. I am trying to fit the datatable to fit inside a Google InfoWindow. Below is a snippet of code outlining how I approched to deal with this situationl [code] function drawTable(items,e) { var tmpStr = ""; var tmpStr2 = ""; var contentString = [ '<div class="tabs">', '<ul>', '<li><a href="#tab-1"><span>E. Coli Results</span></a></li>', '<li><a href="#tab-2"><span>Cyanobacteria + Microcystin Results</span></a></li>', '</ul>', '<div id="tab-1">', '<h1 style="color:red">' + beach_location + '</h1>', '<p>' + beach_region + '</p>', '<table class="data" id="ecoli_table" style="width:100%">', /* '<tr>', '<th>Sample Date</th>', '<th>Average E. coli Density <br/>(E. coli / 100 mL of sample)</th>', '<th>Recreational Water Quality Guideline <br/> (200 E. coli / 100 mL of sample)</th>', '</tr>' */ ].join(''); // add Ecoli Rows for (var j = 0; j < items.length; j++) { //console.log(items[j]); tmpStr = tmpStr + '<tr> <td>' + items[j][5] + '</td><td>' + items[j][6] + '</td><td>' + items[j][7] + '</td></tr>'; } //contentString = contentString + tmpStr + '</table></div></div>'; contentString = contentString + tmpStr + '</table></div>'; var contentString2 = [ '<div id="tab-2">', '<h1 style="color:red">' + beach_location + '</h1>', '<p>' + beach_region + '</p>', '<table class="data" id="algae_table" style="width:100%">', /* '<tr>', '<th>Sample Date</th>', '<th>Algase Toxin Microcystin</th>', '<th>Recreational Guideline 20ug</th>', '<th>Blue Green Algae Cells</th>', '<th>Recreational Guideline</th>', '</tr>' */ ].join(''); // add Algae Rows for (var j = 0; j < items.length; j++) { //console.log(items[j]); tmpStr2 = tmpStr2 + '<tr> <td>' + items[j][9] + '</td><td>' + items[j][10] + '</td><td>' + items[j][11] + '</td><td>' + items[j][12] + '</td><td>' + items[j][13] + '</td></tr>'; } contentString2 = contentString2 + tmpStr2 + '</table></div>'; contentString = contentString + contentString2 + '</div>'; infoWindow.setContent(contentString); infoWindow.setPosition(e.latLng); infoWindow.open(map); $(".tabs").tabs({ selected: 0 }); $("#ecoli_table").dataTable({ "sPaginationType": "full_numbers", "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], "aaSorting": [[0, "desc"]], "bAutoWidth": false, "aoColumns": [ { "sWidth": "25px", "aTargets": ["_all"], "sTitle": "Sample_Date" }, { "sWidth": "25px", "aTargets": ["_all"], "sTitle": "Average_E._coli_Density" }, { "sWidth": "25px", "aTargets": ["_all"], "sTitle": "Recreational_Water_Quality_Guideline" } ], "bProcessing": true, /* "aoColumns": [ { "sTitle": "Sample_Date" }, { "sTitle": "Average_E._coli_Density" }, { "sTitle": "Recreational_Water_Quality_Guideline" } ] */ }); $('#algae_table').dataTable({ "sPaginationType": "full_numbers", "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], "bAutoWidth": true, "bProcessing": true, "aaSorting": [[0, "desc"]], "aoColumns": [ { "sTitle": "Sample_Date" }, { "sTitle": "Algal_Toxin_Microcystin" }, { "sTitle": "Recreational_Guideline_20" }, { "sTitle": "Blue_Green_Algae_Cells" }, { "sTitle": "Recreational_Guideline" } ] }); } [/code] Any suggestions are greatly appreciated. Thanks in advance. Michael