I am not seeing any console output with the first ajax request (after page load).
The preXhr.dt
event doesn't seem to fire until i sort or search.
...on('preXhr.dt', function ( e, settings, data ) {
console.log('preXhr',data);
});
I am not seeing any console output with the first ajax request (after page load).
The preXhr.dt
event doesn't seem to fire until i sort or search.
...on('preXhr.dt', function ( e, settings, data ) {
console.log('preXhr',data);
});
I used the download builder to create http://plnkr.co/edit/vFXRDh?p=preview
What's wrong with Search-field (not on the same line with buttons)?
To see a bug make a result window wider.
Filtering my table with this function:
$.fn.dataTable.ext.search.push( function ( settings, searchData, index, rowData, counter ) {
if(
(((btnArchief==0) && (searchData[1]=='0')) || ((btnArchief==1) && (searchData[1]=='1'))) &&
(((btnRelatie==0) && (searchData[2]=="0")) || ((btnRelatie==1) && (searchData[2]=="1")))
){
return true;
}
return false;
};
});
When there are more than 1 table on the page, this filtering will occur on ALL tables. So I need to identify each table. In Version 9 i could identify the table with :
if ( oSettings.nTable.id == 'client05' ) {
so I presume that the table id will be found in settings.
Can you please tell me where I can find the values of "settings" and how to use them?
I am trying to use serverSide=true
, search: {regex: true}
with sqlalchemy-datatables
python on the server side.
I am trying to update sqlalchemy-datatables to support regex. I have successfully added regex on the server side with mysql to handle OR regex on a column (as provided by yadcf select2 multiselect function).
I am also trying to support regex (again with mysql) for the table search, but when I type the OR bar ("|") into the search, the database side raises an exception because there is an empty regex subexpression received.
OperationalError: (OperationalError) (1139, "Got error 'empty (sub)expression' from regexp")
Is there any way to have datatables wait for the user to make the search box contain a valid regex expression before sending it to the server?
(It turns out that sqlalchemy, which is an sql framework for python, only provides mechanisms to support regex with a couple of database engines, and each of these are handled differently. yuck)
hi there,
i had written my own version of the old ColVis plugin a few months ago (tragically it was about 2w before you came out with the latest release and a more robust, efficient version of it doh!). I do something like this:
if (toggleColsOn.length > 0) dtApi.columns(toggleColsOn).visible(1, true); redraw = true;
if (toggleColsOff.length > 0) dtApi.columns(toggleColsOff).visible(0, true); redraw = true;
if (redraw) dtApi.columns.adjust().draw(false);
I track what the user wants to add/remove from their view and then upon clicking an update function build out the specs to pass on to the columns(myArray).visible()
method.
The issue is that my table shrinks when I do this rather than staying full within the modal it's operating in, the original bounds of the <div>
it is nested in. What would be the best way to maintain a full width here?
Best,
I noticed that after replacing the default DT style with Bootstrap styling dt-right
and dt-nowrap
no longer works.
Can't find any information that I should use Bootstrap specific commands for these options to work..
$(document).ready( function () {
var table = $('#example').DataTable({
"columnDefs": [
{ className: "dt-right", "targets": [3,5] },
{ className: "dt-nowrap", "targets": [0,1] }
]
});
} );
Hi
I have added a fonction witch need to clear and load new data from server
I was hoping DataTables to get the "Loading ..." message that I get when refresh or load the table for the first time I get nothing.
first i tried
oTable.clear().draw();
witch display "No data available in table"
and then I do
oTable.ajax.url("../link?parm1=1&parm2=2").load();
"No data available in table" will not change to "Loading ..." until the data is all process
I remove the
oTable.clear().draw();
then screen wont change until the data is all process
debug code is owabuv
Thanks in advance
i try this code:
searching: {
columns: ":visible"
},
and its not work.. can you help me?
thx.
i am using
ajax: function (data, callback, settings) {
var dat = JSON.parse(myTableName.getData(true));
callback(dat)
},
and cant get search o work and i have no errors.
Hi,
Recently after upgrading from 1.10.10 to 1.10.11 we noticed that the child rows are rendering with colspan="0" which makes the child row squish into the first column. This table in particular has 6 visible columns. After some digging it looks like there was change made to _fnVisbleColumns
:
1.10.10
function _fnVisbleColumns( oSettings )
{
return _fnGetColumns( oSettings, 'bVisible' ).length;
}
1.10.11
function _fnVisbleColumns( oSettings )
{
return $( _pluck( oSettings.aoColumns, 'nTh' ) ).filter(':visible').length;
}
Any thought as to why my visible columns are being filtered out causing this function to return 0?
Thanks in advance,
Kurt
I am getting an error when displaying DataTables. Debugger code: ujipef
See https://www.ficos.nl/oostveen-advies/testajaxdatatable/index.html
What have I done wrong? The tables are ok, json is returning nice answers.
Jan
Dattatables is using lodash . My question is how can i avoid loading loadsh if allready loaded
When my datatable is first created i call a function GetJsonData()
var jsonData = GetJsonData();
When i initiate the datatable my data field looks like this.
"data": JSON.parse(jsonData).data
GetJsonData makes an ajax call and returns my json array. This works fine.
When i want to reload the table i have another function called reloadTable
function reloadTable() {
var table = $('#tblCases').DataTable();
var jsonData = JSON.parse(GetJsonData()).data;
table.ajax.reload(jsonData);
}
you can see this function calls the same function GetJsonData which works on the initial load.
I checked the json that is being returned and json lint says its valid. I can post the json object if needed.
Is there something else i am doing wrong?
Here is an example. It isn't throwing the same errors, but its also not working. If you click on the button to reload the table it throws errors in the console.
http://live.datatables.net/zibohaji/5/edit?html,css,js,output
As discussed at: https://datatables.net/forums/discussion/6401/change-the-word-search-to-filter -- perhaps needs to be updated. Out of the box my filter input's markup looks like
<div id="ordersTable_filter" class="dataTables_filter">
<label>
Search:
<input class="" type="search" placeholder="" aria-controls="ordersTable">
</label>
</div>
I've tried both:
$('#ordersTable_filter input:search').focus(); // tosses error
and:
$('#ordersTable_filter input:text').focus(); // doesn't work
I cant fnd a way or debug why footer is not rendered. Possible cases, or issues?
Is there any update on the availability of officially supported TypeScript definitions for latest versions of DT?
Dear
We encounter one datatables issue, when I set "scrollX": true, the datatable width will change when sort any column, if disable "scrollX", the column width is fixed when sort columns, how can i do, is there any resolve solusion, thanks a lot.
Benny
I'm trying to write an Mjoin direct link in my server-side script to provide Name values from a secondary table (Marker.Name) for foreign key values in the primary table (ModuleCourseworkMarks.MarkerAID, ModuleCourseworkMarks.MarkerBID, ModuleCourseworkMarks.MarkerCID).
I've had success doing this with just one foreign key in the past but am having a bit of trouble understanding how the Mjoin syntax works, even with the documentation!
So far I've got this:
$editor = Editor::inst($db, 'ModuleCourseworkMarks', 'ModuleCourseworkMarkID')
...
Field::inst('ModuleCourseworkMarks.MarkerAID')
->options('Markers', 'ID', 'Name')
->validator( 'Validate::dbValues' ),
Field::inst('ModuleCourseworkMarks.MarkerBID')
->options('Markers', 'ID', 'Name')
->validator( 'Validate::dbValues' ),
Field::inst('ModuleCourseworkMarks.MarkerCID')
->options('Markers', 'ID', 'Name')
->validator( 'Validate::dbValues' )
Field::inst('Markers.Name')
...
->leftJoin('Student', 'Student.StudentID', '=', 'ModuleCourseworkMarks.StudentID')
->leftJoin('ModuleHistory', 'ModuleHistory.ModuleID', '=', 'ModuleCourseworkMarks.ModuleID')
->leftJoin('CourseWorkStatus', 'CourseWorkStatus.id', '=', 'ModuleCourseworkMarks.CourseworkStatusID')
->leftJoin('Modules', 'Modules.ModuleID', '=', 'ModuleCourseworkMarks.ModuleID')
->join(
Mjoin::inst('Markers')
->set( false )
->link('ModuleCourseworkMarks.ModuleCourseworkMarkID', 'Markers.ID')
->fields(
Field::inst('ModuleCourseworkMarks.MarkerAID'),
Field::inst('ModuleCourseworkMarks.MarkerBID'),
Field::inst('ModuleCourseworkMarks.MarkerCID')
)
);
courseworkMarksTable = $('#CourseworkMarksTable').DataTable({
...
"columns": [
{data: "Markers.Name", editField: "ModuleCourseworkMarks.MarkerAID", className: "editableInline"},
{data: "Markers.Name", editField: "ModuleCourseworkMarks.MarkerBID", className: "editableInline"},
{data: "Markers.Name", editField: "ModuleCourseworkMarks.MarkerCID", className: "editableInline"}
]
but it's resulting in my receiving the following SQL error being alerted in the browser:
"The multi-part identifier "Markers.Name" could not be bound."
Unfortunately with the site running on our intranet server and tightly integrated with our internal SQL database I'd be unable to replicate the issue using JSFiddle or Datatables Live.
The default placeholder doesn't seem to work when using chosen js plugin. I tried using data-placeholder but that breaks. When using just placeholder it just keeps coming up with the default selection, "select an option".
fields: [
{
"label": "Select A Vendor:",
"name": "vendor_select",
"type": "chosen",
"options": {
placeholder: "Select A Vendor"
}
}
]
Is that confirmed issue, or is it in my implementation only that the filter input fires twice. Once immediately on the first letter typed, and second time after the set delay time. I see that in few of my datatables implementations for version 1.10.10