Search
11456 results 9011-9020
Forum
- 28th Jun 2013debug the results in Custom column filtering@allan I am using custom column filtering.I need to know how to check the Returned search results after using custom column filtering.Beacuse it always return 0 results. My code: function FilterTable(Name,Type){ $('#tableRows').dataTable().fnFilter(Name, 1, true, false); $('#tableRows').dataTable().fnFilter(state, 2, Type, false); alert($('#tableRows').dataTable()); } It returns 0 results always.It means empty alert came in the result.Is it possible to debug the results or how to check the results after values passing in fnFilter?
- 14th May 2013Filtering number by exact matchHi, I am using DataTables for displaying Results of a athletic competition over several years. It works like a charm, thanks a lot!! Now I would like one of the columns to be filtered by exact match. I read a lot of forum questions here and on stackoverflow and I tried several different ways, but non of them seem to work.. The column is the 7th column (zero based nr. 6). Here is my code: DataTable Initialization: [code] "oSettings":{ "aoPreSearchCols":[ null, null, null, null, null, null, { "bSmart" : "false", "bRegex" : "false", "sSearch" : "^\s"+'1'+"\s$" }, null, null, null, null, null, null, null, null, null, null, null, null, null, ] }, "aoColumns": [ null, null, null, null, null, null, { "type" : "number", "sType": "numeric" }, { "sType": "time-milli" }, null, null, null, null, null, null, null, null, null, null, null ], [/code] I also tried it with setting it after initialization, but it didn't work either. What am I doing wrong? THanks for your help. Regards Jan
- 12th Apr 2013Customize filters, dropdownlenght, info and paginationHello everyone is there a way to connect the actual default features of the plugin with my own inputs, dropdowns, paginations ... I dont want them to be in top of my (or anywhere near or next to the table, as with sDom). I would like to place these elements on a navigation bar for example. Thanks in advance.
- 25th Mar 2013aoData not defined when filteringUsing DataTables 1.9.4 there seems to be a bug. If you have used the search/filter option and no rows are visible, then you call "fnAddData" to add some additional rows and one of these rows matches the search/filter criteria, a popup appears. In the minimised version this is "e not defined", in the maximised version it's "aoData not defined". Does anyone know how to fix this?
- 6th Feb 2013DataTables individual column filtering example - issue with filteringHello, When I implement this, and enter a value in a footer input, all data disappears from the table - even if I only enter a single letter. Have you encountered this before? Is there a common fix? Thank you.
- 17th Nov 2012DataTables individual column filtering example (multi_filter_select) with Server-side processingForgive me but I am a new user ... I would like to create a table of data coming from my external database mysql. So far, so good. My issue comes up in "select". This is my code: PAGE /1/ function fnCreateSelect( aData ){ var r=' Select... ', i, iLen=aData.length; for ( i=0 ; i<iLen ; i++ ) { r += ''+aData[i]+''; } return r+''; } /2/ (function($) { $.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { if ( typeof iColumn == "undefined" ) return new Array(); if ( typeof bUnique == "undefined" ) bUnique = true; if ( typeof bFiltered == "undefined" ) bFiltered = true; if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true; var aiRows; if (bFiltered == true) aiRows = oSettings.aiDisplay; else aiRows = oSettings.aiDisplayMaster; var asResultData = new Array(); for (var i=0,c=aiRows.length; i<c; i++) { iRow = aiRows[i]; var aData = this.fnGetData(iRow); var sValue = aData[iColumn]; if (bIgnoreEmpty == true && sValue.length == 0) continue; else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue; else asResultData.push(sValue); } return asResultData; } }(jQuery)); /3/ $(function() { $("#test").button().click(function() { /3.1/ var oTable= $('#userDataTable').dataTable( { "bProcessing": true, "bServerSide": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "oLanguage": {"sSearch": "Cerca in tutte le colonne:"}, "sAjaxSource": "/php/userDataTable.php" }); /3.2/ $("tfoot th").each( function ( i ) { this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) ); $('select', this).change( function () { oTable.fnFilter( $(this).val(), i ); } ); } ); $( "#testWindow" ).dialog( "open" ); }); $( "#testWindow" ).dialog({ autoOpen: false, width: 900,}); }); </script> </head> <body> <div id="Page" align="center"> <button id="test">Test</button><br /> </div> <div class="dialogCenter" id="testWindow" title="TEST WINDOW"> <table class="display" id="userDataTable"> <thead align="center"> <tr> <th>Surname</th> <th>Name</th> <th>Username</th> <th>Email</th> <th>Level</th> <th>Accesso</th> <th>Valid</th> <th>Active</th> </tr> </thead> <tbody> <tr class="gradeA"> <td class="dataTables_empty">Loading data from server</td> </tr> </tbody> <tfoot> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> <th></th> </tfoot> </table> </div> </body> I suppose that the problem is out because the data is inserted after initializing the columns (up 3.1 part after the function 2). I tried to call the functions correctly, but I get an error (Uncaught TypeError: Object [object Object] has no method 'fnGetColumnData') .... I think that there is a syntax error .... The best thing would be to put it in a file esetrno (/ js / function.js). Can anyone help me??
- 8th Oct 2012Multiple search filteringI'm a bit of a newbie to datatables, and I couldn't find an answer to this question anywhere on the forums, maybe just not looking in the right places. I was wondering if I had two text inputs, whether I can do an OR style search through datatables, so instead of the text in both inputs needing to be both in the search result, that either of them can be in the results. Hope that makes sense. Thanks in advance.
- 19th Sep 2012Why is my DataTable headers not sorting and the fields not filtering?Reports First Name Last Name Grade Attendance Code Class Day Reports First Name Last Name Grade Attendance Code Class Day @foreach (var item in Model.Enrollments) { @Html.HiddenFor(modelItem => item.EnrollmentID) @Html.HiddenFor(modelItem => item.Assignment) @Html.HiddenFor(modelItem => item.Course.Title) @Html.HiddenFor(modelItem => item.CourseID) @Html.HiddenFor(modelItem => item.Date) @Html.HiddenFor(modelItem => item.dayOfWeek) @Html.HiddenFor(modelItem => item.Instructor) @Html.HiddenFor(modelItem => item.StudentID) @Html.HiddenFor(modelItem => item.Student.Address) @Html.HiddenFor(modelItem => item.Student.CourseID) @Html.HiddenFor(modelItem => item.Student.Courses) @Html.HiddenFor(modelItem => item.Student.EnrollmentDate) @Html.HiddenFor(modelItem => item.Student.Enrollments) @Html.HiddenFor(modelItem => item.Student.FullName) @Html.HiddenFor(modelItem => item.Student.InstructorID) @Html.HiddenFor(modelItem => item.Student.Instructors) @Html.HiddenFor(modelItem => item.Student.StudentID) @Html.ActionLink("Report", "PrintCustomers", "PdfRender", new { sName = item.Student.FirstMidName, courseTitle = item.Course.Title, sNumber = item.Student.StudentNum, instructorName = HttpContext.Current.Session["teacherName"] }, null) @Html.EditorFor(modelItem => item.Student.FirstMidName) @Html.EditorFor(modelItem => item.Student.LastName) @Html.TextBoxFor(modelItem => item.Grade, new { Value = "0" }) @Html.ValidationMessageFor(model => model.Enrollments.FirstOrDefault().Grade) @Html.TextBoxFor(modelItem => item.attendanceCode, new { Value = "1" }) @Html.ValidationMessageFor(model => model.Enrollments.FirstOrDefault().attendanceCode) @Html.EditorFor(modelItem => item.classDays) } <br /> <Input Type ="submit" Value="Submit Attendance"/> }
- 5th Sep 2012While filtering does not apply changes to the tableI am using fnRowCallback to highlight and make some modifications to the table. It works fine when I load the page, everything works as per the code. This is the following code I have [code] if(aData[17] != null) { $('td:eq(0)', nRow).html(" "); $(nRow).find('td:contains("edit")').html("edit"); $(nRow).css({'background-color':'#999999','color':'#E4E4E4', "cursor": "default"}); } [/code] When I enter text in the search field [code] $('td:eq(0)', nRow).html(" "); $(nRow).find('td:contains("edit")').html("edit"); [/code] do not seem to work. It would not replace the first column with the cancel icon, and also do not change the edit hyperlink to edit text. Is something wrong with my code or is there anything I am forgetting.
- 27th Aug 2012Column filtering on table headerHow can I change the default location of column filters to now be displayed on the table header?