Search
43861 results 7321-7330
Forum
- 22nd Jan 2014jquery datatable plugin aadata format not displaying the tableIam newbie to jquery. Iam working with jquery datatable plugin . I tried to display the array of aadata with datatable but iam not getting datatable displayed, only empty page i could see. Can anyone help me where i went wrong? Below is the code i used. [code] $(document).ready(function () { var Listobj = new Array(); var downloadClick = "<center><img src='Image/Download.png' style='cursor:pointer' onclick=callDownload('','','','') /></center>" var callPlayVedio = "<center><img src='Image/Play.png' style='cursor:pointer' onclick=callPlayVedio('','','','') /></center>" $.getJSON("sources/jsondata.json", function (data) { var dataobj = $.parseJSON(JSON.stringify(data)); $.each(dataobj, function (key, val) { if (key == "contents") { for (var i = 0, l = val.length; i < l; i++) { var obj = val[i]; var auctualSize = ((obj.size) / 1024).toFixed(2) + " kb"; Listobj[i] = new Array(obj.key, obj.lastModified, auctualSize, downloadClick, callPlayVedio, "<center><img src='Image/share.png' style='cursor:pointer;width:16px;height:16px;'/></center>"); } } }); TableDisplay(Listobj); }); }); function TableDisplay(Tablevalues) { alert("sec"+Tablevalues); $('#table_test').html(''); $('#example').dataTable({ "aaData": Tablevalues, "aoColumns": [ { "sTitle": "Files" }, { "sTitle": "Date and Time" }, { "sTitle": "size"}, { "sTitle": "Download"}, { "sTitle": "Play"}, {"sTitle": "share"}] }); }; and my json values are var myjson='[{"isTruncated": "false","nextMarker": "null","marker": "null","prefix": "Mymedia/mysys/","contents": [{"deviceInfo": "null","lastModified": "Thu Dec 26 16:36:42 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key":"Mymedia/mysys/audio_$folder$","size": "0"},{"deviceInfo": null,"lastModified": "Thu Dec 26 16:36:11 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key": "Mymedia/mysys/doc_$folder$","size": "0"},{ "deviceInfo": null,"lastModified": "Thu Dec 26 16:36:20 IST 2013", "etag": "d41d8cd98f00b204e9800998ecf8427e","key": "Mymedia/mysys/imge_$folder$","size": "0"},{"deviceInfo": null,"lastModified": "Thu Dec 26 16:36:56 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key":"Mymedia/mysys/others_$folder$","size": "0"},{"deviceInfo": null,"lastModified": "Thu Dec 26 16:36:32 IST 2013","etag": "d41d8cd98f00b204e9800998ecf8427e","key": "Mymedia/mysys/video_$folder$","size": "0"}],"name": "name", "statusCode": "200","statusMessage": "Success","error": null}]'; [/code]
- 8th Jan 2014Struggling with table rendering if bStateSave is enabledI have this issue in chrome jquery.dataTables.js:6705 Cannot read property 'asSorting' of undefined and firefox, same line, but a different error TypeError: oColumn is undefined I have seen lots of posts about this but cannot debug it or find a definitive answer, (if there is one). I’m guessing there must be a conflict somewhere, but can’t work out where. I found the debug bookmarklet, and uploaded the offending page, code iwucul Looking through the debug code, i found one thing which may be relevant "saved_aaSorting": "[[0,\"desc\",1]]" on the page with the fault, compared to "saved_aaSorting": [ [3, "asc", 0] ], on a page which runs ok
- 17th Dec 2013Table wont dispaly anything?Here's my debug info: http://debug.datatables.net/uyoqog Regards, Vrutin
- 5th Dec 2013table tools cancel call back function ?Hello All, I hope someone could help me or throw me any idea as I could not find a call back function in the following scenario : CSV/Excel export : There is fnComplete call back function, which get called after "Save" button clicked on modal window. [quote] Is there any specific call back function that gets called when "Cancel" button clicked on modal window ? [/quote] I would like to do alerting the user after save or cancel happens. I appreciate any help! Thanks, Sri
- 4th Dec 2013Table Cell style depend on valueIs it possible to style (by css class) a single cell depend on value?
- 5th Nov 2013Concat whit Data table editorHi I wonder if it is possible to use concat or group_concat in the Datatableeditor tnks
- 17th Oct 2013How to hide the aoColumns when the table content is empty (no rows)I want to be able to hide the column headers when the query returns 0 records. But i still want to have the sEmptyTable message show in the footer. Is there a way to do this ?
- 4th Sep 2013How can i add few more filtering in data table?good day, Could anyone please share with me how can i add more filter criteria and improve the searchable result? Thanks
- 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