Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all 81395 articles
Browse latest View live

Cant get tables working correctly

$
0
0

so guys,
the basic set up of the table seems like it should be fairly easy right?
the Zero Options and it that it has, although when running it even just as a basic set up there is no pagination going on, no "show x per page" or search at the top...

like the table itself is drawing, and has a header row, has a nice amount of styling to the table through the css and that. So it seems that the .js files are loading, and the .css files are loading

though the outer wrapper on the table just isnt there at all?

code taken straight from the example has:

<

div class="dataTables_wrapper" id="example_wrapper">

<

table id="example" class="dataTable display" cellspacing="0" width="100%">

though when using this, it will as said generate the table itself fine, but have no actual content inside of the wrapper?


How to manage passwords with datatable editor (my own logical bug)

$
0
0

So, I have some sort of blackout and I can not figure it how how to approach this. On an super-admin page i have a table with users and their right. For some reasons, the password is set in editor by the super-admin and then the user change it at his/hers convenience.
But...
The password is encrypted with md5. The admin open the modal editing to change some rights or other less important data. When he save the editor, the password is changed from "1234" (basic example) to md5("1234") so of course is not the same anymore.

I know is a silly logical bug, but still, may I get some suggestions how to handle this? How to store and edit password in editor without overwriting it with md5 encryption?

How to fix a PHP Fatal Error: Allowed memory size of XXX bytes exhausted

$
0
0

I have tried to setup server side processing, but cannot seem to get it working. When selecting from a table with 130,000 rows I get a alert message that says the following. DataTables warning: tableid=table Ajax error. Please see http://datatables.net/tn/7

My code is working on smaller tables, one of which has 6,500 records and it handles that OK.

I checked the php logs and see the error below.
FastCGI-stderr: PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36 bytes) in

My code is as below where I have set ServerSide to true and type to Post. Is there something else I still need to do?

$(document).ready(function() {
  $('#table').dataTable( {
    "Processing": true,
    "ServerSide": true,
    ajax: {
        url: 'mysql.php',
        type: 'POST'
    },
    "columnDefs": [ { className: "dt-head-left", "targets": "_all" }  ],
    dom: 'Bfrtlip',
    buttons: [ 'copy', 'excel', 'print'  ]
  } );
} );

Any suggestions would be helpful.

Thanks!
James

Basic table will not render all the way?

$
0
0

Hi,

I am baffled. I am just starting out. I created a basic table for a test and it will not render all the way. All the rows display not just the default 10.

The pagination shows up and if i select a different number of records the rest of the table works.

Link to the test is here. http://eh.magna.net/public/dttest2.html

In the console it says (firefox) TypeError: f is undefined

Don't know why one of my columns isn't sorting

$
0
0

Hi, I'm new here (please bear with me!), website is http://www.oxfordbops.co.uk/ - all scripts are within the home document (ie only a little bit of stuff about the date down the bottom and the links to datatables). Not sure why my 'location' column isn't sorting. Any ideas? Thanks

checkbox columns in data table

$
0
0

Dear Team,
we are using the following example, there we have only one check box column.
https://editor.datatables.net/examples/api/checkbox.html

But we want check box for the multiple columns.

In this below method how to identify the multiple columns(like Active,Status,Expat) and assign the checked flag.

rowCallback: function ( row, data ) {
// Set the checked state of the checkbox in the table
$('input.editor-active', row).prop( 'checked', data.active == 1 );
}

Please furnish solution ASAP

scrollTo() specific row in the next pagination

$
0
0

i'm already implement the scroller for datatable and want to use scrollTo function
the pagelengthdisplay is 63 and when i do table.row(70).scrollTo(), it can't be done
the function tell that no index was found in the page

when i do table.row(60).scrollTo() it work nicely

how can i make that table.row(70).scrollTo() to work, any solution for this problem
thank you,
edos

How to invoke Export, Print button on click functionality for bootstrap buttons

$
0
0

Hello,

I just want to know to invoke on click functionality of datatables button to my bootstrap buttons , without initializing datatables buttons.?

on click of bootstrap button Export or print of Datatables should work.

I am defining like this
datatableID.buttons('.buttons-print').trigger();

But for this to work there should be datatables buttons initialised which i dont want.

Can anyone help my out regarding this. ?

Thanks


checkbox columns in data table

$
0
0

Dear Team,
we are using the following example, there we have only one check box column.
https://editor.datatables.net/examples/api/checkbox.html

But we want check box for the multiple columns.

In this below method how to identify the multiple columns(like Active,Status,Expat) and assign the checked flag.

rowCallback: function ( row, data ) {
// Set the checked state of the checkbox in the table
$('input.editor-active', row).prop( 'checked', data.active == 1 );
}

Please furnish solution ASAP

Table with multiple underscores fails to return integer values

$
0
0

I'm noticing strange behavior with Editor 1.6.1 for PHP. When I set up my PHP script to process the Editor, I only see some values being returned in the table. They happen to be only the varchar fields from the table. All integer and char fields are returning as NULL in the debug console. I have another Datatable displaying integer values just fine. After troubleshooting everything including leftJoins, where clause, and commenting out individual fields one by one, I determined that the issue seemed to lie with the table name.

Here is a bit about my setup: I'm using SQL Server 2012 R2 as the database back-end, PHP 5.4.16 running on Apache 2.4.6. Also using Bootstrap 3.3.7 and jQuery 3.1.0 scripts, but I imagine that doesn't matter much in this case. I just want to provide a complete picture to my environment.

I'll provide my server-side code to give an idea of what works and what doesn't:

This works but integer and char fields return as null values (data is actually not returned from the DB, it's not just missing from the table):

Editor::inst( $db, 'dynamic_sku_config, 'id' )
    ->fields(
        Field::inst( 'dynamic_sku_config.product_family_id' )
            ->options( Options::inst()
                ->table( 'product_family' )
                ->value( 'id' )
                ->label( 'name' )
            ),
        Field::inst( 'dynamic_sku_config.component_type_id' )
            ->options( Options::inst()
                ->table( 'component_type' )
                ->value( 'id' )
                ->label( 'name' )
            ),
        Field::inst( 'dynamic_sku_config.ordinal_position' ),
        Field::inst( 'dynamic_sku_config.following_delimiter' ),
        Field::inst( 'dynamic_sku_config.min_components' ),
        Field::inst( 'dynamic_sku_config.max_components' ),
        Field::inst( 'dynamic_sku_config.action' ),
        Field::inst( 'product_family.name' ),
        Field::inst( 'component_type.name' )
    )
    ->leftJoin( 'product_family', 'product_family.id', '=', 'dynamic_sku_config.product_family_id' )
    ->leftJoin( 'component_type', 'component_type.id', '=', 'dynamic_sku_config.component_type_id' )
    ->where( 'dynamic_sku_config.product_family_id', $_POST['selectedProductFamily'], '=' )
    ->process( $_POST )
    ->json();

In the above example, here are the database field types (each table has a field named "id" as an integer primary key):

dynamic_sku_config
product_family_id, int
component_type_id, int
ordinal_position, int
following_delimiter, char(1)
min_components, int
max_components, int
action, varchar(16)

component_type
name, varchar(50)

product_family
name, varchar(50)

Interestingly, since I'm joining to other tables for product_family and component_type, the Datatable will display the name field from the joined tables (product_family_id and component_type_id are not displayed to the user). The action field is also displayed as it is varchar. Every other field is blank due to null values coming back from the server.

I copied the contents of dynamic_sku_config into another table called dskutest. Here is the modified code (identical to above except for the table name):

Editor::inst( $db, 'dskutest', 'id' )
    ->fields(
        Field::inst( 'dskutest.product_family_id' )
            ->options( Options::inst()
                ->table( 'product_family' )
                ->value( 'id' )
                ->label( 'name' )
            ),
        Field::inst( 'dskutest.component_type_id' )
            ->options( Options::inst()
                ->table( 'component_type' )
                ->value( 'id' )
                ->label( 'name' )
            ),
        Field::inst( 'dskutest.ordinal_position' ),
        Field::inst( 'dskutest.following_delimiter' ),
        Field::inst( 'dskutest.min_components' ),
        Field::inst( 'dskutest.max_components' ),
        Field::inst( 'dskutest.action' ),
        Field::inst( 'product_family.name' ),
        Field::inst( 'component_type.name' )
    )
    ->leftJoin( 'product_family', 'product_family.id', '=', 'dskutest.product_family_id' )
    ->leftJoin( 'component_type', 'component_type.id', '=', 'dskutest.component_type_id' )
    ->where( 'dskutest.product_family_id', $_POST['selectedProductFamily'], '=' )
    ->process( $_POST )
    ->json();

All fields are now populating in the Datatable with no changes to the front-end page. I should point out that tables with a single underscore in them (e.g., product_family, component_type, etc.) work without issue. I hadn't captured the actual query being sent to the SQL Server but I could probably get it if it would be of interest or provide any clues as to why this might be happening.

I didn't see anyone else with this same issue on the forums, so I thought I would post it myself, either as a workaround for anyone encountering the same issue (or maybe a bug fix for a future release!).

num-html does not work

folder select dialog

$
0
0

i am using datatable editor. i would like to have a folder selector dialog to get a path. is there a built-in function for this?

Garbage datetime data in exported csv

$
0
0

I'm using datatables for showing more than 50000 record, which becomes very slow while rendering. I have 21 columns in that table. While exporting the whole table to csv, i get garbage datetime value in csv e.g: Suppose date to export: 24/10/2016 : 06:06:10, which after shows '‎24‎/‎10‎/‎2016 ‎07‎:‎06‎:‎10'.

Can anyone suggest anything regarding this issue?

EDITOR - is possible to disable multi-info on multi-row edit?

$
0
0

Hi all,

I want to know if its posible to disable this message:

MULTIPLE VALUES
The selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.

and the fileds appears without clicking on this message as other fileds that have the same values on multiedit.

Thanks in advance.

Getting wrong message "Showing 151 to 144 of 144 records"

$
0
0

When i change the show count value, while on the last page, results in a blank page being added to the page display. & If the last page is selected "No records were found" is displayed and showing count is outside of the range of available records.
"Showing 151 to 144 of 144 records"


My web api works fine.But datatable shows "no data available in table".I have attached the script.

$
0
0

$(document).ready(function () {
$('#tblEmployee').DataTable(
{
ajax: {
"url": "http://localhost:57507/api/Employee/Get",
"dataSrc": ""
}
,
columns : [
{ data: 'Employee_Id' },
{ data: 'Project_Id' },
{ data: 'Grade_Id' },
{ data: 'Site_Id' },
{ data: 'Location_Id' },
{ data: 'StartDate' },
{ data: 'EndDate' },
{ data: 'BillRate' },
{ data: 'Role' },
]
}
);
});

Add custom parameter with .draw()

$
0
0

Hello,

I'm using DataTables with serverSide processing. Now I want to send an extra parameter with the request so I can do some grouping of data. For the initial call, I can do this by adding data to the "ajax".

var dt = $('#products').DataTable({
  "processing": true,
  "serverSide": true,
  "ajax": {
    "url": "{{ route('product.data') }}",
    "data": function(d){
      d.grouping = 1;
    }
  },

This adds a parameter "grouping" with the value of "1".

No I have created multiple filters for the data, on a button click I'm redrawing the table to get the filtered products.

$("[data-search]").click(function () {
  // Setting dt.columns(x).search('')
  dt.draw();
});

How will I be able to modify the 'grouping' value just before calling dt.draw()?

disable the auto sort if we update the sorting column

$
0
0

Hi
How to disable the auto-sort if we update the sorting column.
thanks

Single Row Delete Editor hangs

$
0
0

Hi Support,
I am trying to delete row through Editor , If table contains multiple rows then delete works well and if table having single row and if delete then editor hangs. I am using below code to delete.

$('#achievementtable').on('click', 'tbody td.editor_remove', function (e) {
e.preventDefault();
if ($('#ach_repid').val() == $('#ach_loginid').val()) {
editor.remove( $(this).parents('tr')[0], '123', false, false );
editor.submit();
}
} );

Regards.
Sunil

Datatable with Knockout and Editor extension

$
0
0

Hi everyone, I want to use Editor extension in datatables using knockout but I can't find an example. Is this possible? Any help is appreciate.
Elena

Viewing all 81395 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>