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

Realign fixed headers when table size changes

$
0
0

I'm using the fixed headers for my datatable, and it works. But when I change the table size without reloading the page, they get horribly misaligned. They don't auto adjust to the new table size.

The weirdest part is, if I open up debug console using "Inspect Element" the fixed headers actually auto adjust to the appropriate size, and I can't find out why.

Does somebody know how to fix this problem?

P.S. I'm using the Bootstrap Angle theme.


Buttons in cell won't work with ajax source

$
0
0

... but they do work with javascript source.

Here's a simple test case.

http://live.datatables.net/fupinifi/2/edit

If I move the input data to a file and use ajax to load it, the button clicks stop working. I have the few lines to load the ajax source commented out in the script. The content of example.json is just the same array that I have assigned to 'data' at the top of the script.

Appreciate some help!!

Editor for asp.net mvc without database

$
0
0

Hi,

We are already using DataTables in our asp.net mvc 5 web application and are considering buying Editor to support local, inline editing. We appreciate the existence of the .net libraries for server side code but are a bit confused about how the whole thing work and if it is going to fit our needs.

More specifically, there is no database in our project. The data are provided by web services, instead. Right now, we are using a simple ajax Datatables call to fetch and show the data. Everything (the columns, the rendering etc) is defined client-side in the DataTables initialization.

Is the Editor .net library any good to us? or is it specifically for database connection only?

Custom Filtering

$
0
0

Im using yadcf 1.10 and im trying to do the following:

i have a multi_select filter above some Columns and i want that only those rows are shown, which DONT contain the selected values.

Example:

| col1 |

| apple |
| beer |
| plant |
| tree |
| meat |
| fish |
| tree/beer |
| meat/apple |

==> i select apple AND beer:

| col1 |

| plant |
| tree |
| meat |
| fish |
| tree/beer |
| meat/apple |

==> cleared search and now selecting tree AND beer AND meat AND fish:

| col1 |

| apple |
| plant |
| meat/apple |

How can i do this server-side?

Right align column

$
0
0

Hi
Is there a simple way to right align a column?

Uncaught TypeError: Cannot read property 'adjust' of undefined

$
0
0

I'm using the Fixed Header datatable function, but I have a problem. Every time I try to call the function "adjust", I get the TypeError. I have all of the JavaScript plugins included, so I don't know what is going on here.

Uncaught TypeError: Cannot read property 'adjust' of undefined
at HTMLDocument.<anonymous> (header:3199)
at fire (jquery-1.12.4.js:3232)
at Object.fireWith [as resolveWith] (jquery-1.12.4.js:3362)
at Function.ready (jquery-1.12.4.js:3582)
at HTMLDocument.completed (jquery-1.12.4.js:3617)

JavaScript plugins
"//code.jquery.com/jquery-1.12.4.js"
"https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"
"https://cdn.datatables.net/responsive/2.1.1/js/dataTables.responsive.min.js"
"https://cdn.datatables.net/fixedheader/3.1.2/js/dataTables.fixedHeader.min.js"

Dropdown in the bfrtip line

$
0
0

Is it possible to put a select Box beside the search field?
If yes, how can I do this?

Andreas

Update nb selected row whene rows(selector).remove()

$
0
0

Hello,
When I use table.rows('.myClass').remove(), the number of select row is not updated.

I must be used :
table.rows('.myClass').deselect().remove().draw();

Can you help me please ?


using a bootstrap dropdown button for the datatable.buttons

$
0
0

Is it possible to add the datatable buttons( print, csv, copy etc) to a bootstrap dropdown button?

I have tried several ways and just can't seem to figure it out. Does anybody know of any example code implementing this which i could use and modify?

Thank you.

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!).

how to align or change position of paging

$
0
0

I have a requirement regarding aligning of paging and other datatable information like filter, information, length. I want to align them in a customized way like top, center(middle), bottom,right,left . I want to specify margins(left,right,bottom,top) . Can i add CSS to them.

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

Export to Excel hangs on IE11 (>10k records)

$
0
0

Hello

Im using datatables for displaying data on the webpage. Have also added and Export button which would export the data in Excel format.
There are around 10k records that would be displayed /filtered. The export to excel doesnt work when tried from IE11 however the same works from Chrome (Version 42.0.2311.13).
Can you advise if this is a known issue and is there any fix for it.

Code snippet from js file:

var table = $('.tableContent').DataTable({
    "autoWidth": false,
    "pageLength": 50,
    dom : 'lBfrtip',
    buttons : [ {
        extend : 'excel',
        text : 'Export to Excel',
        exportOptions : {
            modifier : {
                // DataTables core
                order : 'index',  // 'current', 'applied', 'index',  'original'
                page : 'all',      // 'all',     'current'
                search : 'none'     // 'none',    'applied', 'removed'
            }
        }
    } ],
    "columnDefs" : [{
        "targets" : [ 0, 1, 2, 8, 9, 10, 11,  17, 18 ],
        "visible" : true,
        "searchable" : true
    }, {
        "targets" : [ 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 19, 20, 21 ],
        "visible" : false,
        "searchable" : false
    }]
});

ng-click event not working

$
0
0

actually, i used row.add() api, in that i have added ng-click event which is not working.

table.row.add(x,'

<

p ng-click = "test()"'+y+'</p>',z).draw()

Responsive datatables editor

$
0
0

Hello Everyone,

Is there a possibility to implement responsive datatables editor. I have included the datatables responsive styles.
The datatable became responsive but not editable.

Please advice on this issue.

Thank you


How to export Index column using DataTable TableTool plugin.

$
0
0

Hi I am using dataTables.tableTools.js for exporting DataTable columns. all columns are returning from database for displaying on DataTable including index column which display row numbers. I am generating row number under index column using jquery,when i export my datatable then its exporting all column with proper data.but its exporting index column without row numbers.

Layout Change

$
0
0

I have a table with many filed headings. I do not want to make people horizontally scroll which most people find awkward. I would like to have my table look more like a form or like the popup that comes up when you click on new... Is this possible?

Open event on editor not work

$
0
0

Hi, i have a problem with the open event:
[code]
editor.on('open', function () {
set_LastUpdate();
{ hide: ['IP', 'SUBMASK', 'GATEWAY'] };
} );
[/code]

when I opened the editor for the first time, the event is not called. The second time it works without problems.
How can I fix?
Thanks

How to exclude the filter values row when we use export( table tools)

$
0
0

in all copy, print, excel, etc.. I see all teh possible filter values included in teh exported result and that screws the layout of the exported table! I googled up and see some people talking about include or excluded filttered rows but I can't find something about exclude the fillter values from exported data. Please advise thanks.

Datetime field not showing error message from server

$
0
0

Hi! I'm running into an issue where I'm sending down an error message in the fieldErrors array in json to a datetime field, but the only text displaying in the editor-datetime-error div is 'Error'.

It's finding the correct field and setting an error, but the message doesn't seem to be inserted. Any ideas on what I might be doing wrong?

Viewing all 81392 articles
Browse latest View live


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