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

MJOIN and multiselect filtering issue


data-priority not working with bootstrap?

$
0
0

this is my testing URL:
https://goo.gl/jZJbfX

I have set data-priority to 3 <th> but I see no effect at all.
Also in responsive mode when I click the blue (+) icon I cant type in the textfield.

Yesterday I could make it with the base theme.

Is that possible to use checkboxes instead of buttons in Multi Column collection layout?

$
0
0

Is that possible to use checkboxes instead of buttons in Multi Column collection layout? Please suggest. if possible share an example.

Select All Checkbox is not working

Split pagination after certain row with a class

$
0
0

I have a table with orders and the products from the orders. I don't have made them with the child option, simple listing, just changing the background color of the <tr>.

The problem is that when I paginate the <tr> with the order title is one page and the products from it are in the next page because the tr is the 25th row and the products are the 26th and 27th row and my display length is 25.

Is there a way to add a class to the <tr> that contains order title for this to be the next row on the next page? Although I have to disable displaylength it will be ok.

Thank you for your time.

Editor - datetime doesn't show datepicker

passing parameters to column render function

$
0
0

I want to make a function I can pass to DataTables for rendering columns, mainly so I can make a column a clickable link.

How can I pass not only the function name of the renderer but also a parameter, such as the target url?

I made an example showing how not to do it ;)

http://jsfiddle.net/jasonblewis/u9en604m/

See lines 26-27

tia

Exporting to Excel does not export all rows

$
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.
Currently im using search() (based on column no. 17) in the javascript to only show specific data in the datatables. On clicking export only the filtered data is being exported. I would want to export the entire data without any filter being applied.
1. in the view it should only show the rows where column 17 has a specific value 'abc' (Working)
2. While exporting, it should export entire data i.e column 17 should be having all values as without the search being applied. (Not Working)

Code Snippet:

var table = $('.tableContent').DataTable({
        "autoWidth": false,
        "pageLength": 50,
        dom : 'lBfrtip',
        buttons : [ {
            extend : 'excel',
            text : 'Export to Excel'
        } ],
        "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
        }]
    });

    table.column(17).search('abc', false, false, true).draw();

Insert field format into export excel.

$
0
0

I'm looking over the buttons API for datatables, particularly formatting fields when exporting to xlsx.
Is it possible to format a cell in such a way that excel will treat the field as a time interval once it is loaded in excel, rather than requiring the user to focus and unfocus the cell and get excel's autodetect to kick in?
Something like inserting excel field metadata is how I imagine it would be done.

Thanks,
Matt

Table row colors getting distorted on resize/click events

$
0
0

Hi,
We are facing table row color distortion issue in our application whenever we perform any kind of event like click, scroll or resize.
We got a solution for this as below,

$(window).on('scroll resize', function(){
var table = $('#our-table').DataTable();
table.columns.adjust().draw();
});

We are using properties of datatable like resizeWidth, paginationType, responsive etc.

However this operation has to be done whenever an event occurs. We are looking for better solution so that the datatable need not be adjusted everytime an event occurs.

Thanks,
Chethan

Simple fixed header example not working...why?

$
0
0

hi to all,
In our company we use IE9 (Standard browser for Intranet)

I just tried to implement the basic example for fixed header.
On the datatable website it's working as expected.

But when I try to use it in my html page, it doesn't.
here's my fiddle
I expected the table header to "stop" when reaching the top of my id "contentMain".
Even if I set the top of "contentMain" to 0, it does not work.

Can anyone help me please to find my mistake?

thank you very much,
azfrank

Javascript data - best format for speed

Multiple datatables export only the first's table data

$
0
0

i am trying to initialize 3 datatables with difference data but when i try to export data from second or first its return the data only from first table how cna i fix it

Inline editor with selectize validtion

$
0
0

Hi,

I have my editor configured like this with validation on PreSubmit. However the problem is that editor.field( "ProjectId" ) is always empty when performing the validation checks.

How can I validate a selectize DDL with inline editing?

 editor = new $.fn.dataTable.Editor({
        ajax: {
            type: "POST", url: "/WorkDiary/SaveDetail",dataType: "json",contentType: "application/json",processData: "false",
            data: function(d) {return JSON.stringify(d);}
        },
        table: "#detailTable",
        idSrc: "Id",
        fields: [
            { label: "Id:", name: "Id", type: "readonly" },
            { label: "WorkDiaryId:", name: "WorkDiaryId", type: "readonly" },
            { label: "Time:", name: "WorkTime", type: "readonly" },
            { label: "Activity:", name: "Activity", type: "textarea" },
            {
                label: "Project",
                name: "ProjectId",
                type: "selectize",
                opts: {
                    valueField: "Id",
                    labelField: "Name",
                    searchField: "Name",
                    preload: true,
                    maxItems: 1,
                    load: function(query, callback) {
                        $.ajax({
                            url: "/SelectHelper/GetProjectList",
                            type: "GET",
                            dataType: "json",
                            data: { q: query },
                            error: function() { callback(); },
                            success: function(res) { callback(res); }
                        });
                    }
                }
            },
            { label: "DateCreated:", name: "DateCreated", type: "readonly"  },
            { label: "CreatedBy:", name: "CreatedBy", type: "readonly"  }
        ],
        formOptions: { inline: { onBlur: "submit", submit: "all" } },
        i18n: { edit: { title: "Diary Form" } }
    });

     editor.on( "preSubmit", function ( e, d, action ) {
         if ( action !== "remove" ) {
            var projectId = editor.field( "ProjectId" );
            if ( !projectId.isMultiValue() ) {
                if ( !projectId.val() || projectId.val() === 0 )
                    projectId.error("You must select a project");
            }
            if ( this.inError() ) {
                return false;
            }
        }

dataTable().row() not a function

$
0
0

Hi all, thank you in advance for any support.
I have the following scenario: one datatable that loads data from oData with a custom function (i.e. fnServerData) to manage odata uri parameters ($filter, $sort, ...).
When I tryed to manage the row click to get the content of a single row I got this error:
"Uncaught TypeError: $(...).dataTable(...).row is not a function" (I'm followng the documentation example here: https://datatables.net/examples/api/select_single_row.html )

Am I missing something or am I doing some mistake?

Thank you


Browser Compatibility

$
0
0

Hi,

I am facing an browser compatibility issue with all versions of IE. It's working fine with Chrome, Mozilla and Microsoft Edge but not with IE. I searched and i got the solutions but i haven't found plugins in your site for IE as you have given. What are those extensions that i have to link to my datatables. Below is the screenshot attached for your page and of IE too.

Image link as viewed in IE 11 :- Click Here

Custom Button to Edit a Modal Form

$
0
0

I'm new to DataTables, but I have a custom button that I am using to edit the data in the Modal form. Currently, I like to use the modal form, instead of the standard edit form that comes with the editor. So in the DataTable, I have several rows of data. When I select a row and click on the custom (Edit) button, I want to pass all of the data to the modal form. What is the best way. Thanks.

Problem using other options when Row Grouping

$
0
0

Love the datatables system. I can see so much potential but I can't seem to use any other options when grouping rows. I've put an example here.

http://live.datatables.net/fiwomije/1/

From scouring the forum I think I'm putting the options in the correct place but it seems to have no effect.

Once (if) I get this working I'm hoping to be able to add PDF and Excel export buttons. On a very steep learning curve so I hope this question isn't daft!

Column not searchable but filterable

$
0
0

Hi!
How can I set single column for no global search BUT for filter?
My DT:

    var table = $('#users-table').DataTable({
        "ordering": false,
        "bLengthChange": false,
        pageLength: 50,
        "bDeferRender": true,

        processing: true,
        serverSide: true,
        ajax: '/route',
        columns: [
            { data: 'firstname', name: 'firstname' },
            { data: 'lastname', name: 'lastname' },
            { data: 'list', name: 'list' },
            { data: 'badge', name: 'badge' },
            { data: 'status', name: 'status', orderable: false, searchable: false },
// I want to custom filter for this (status) but it cannot be searchable
            { data: 'action', name: 'action', orderable: false, searchable: false }
        ],
        "language": {
            "url": "//cdn.datatables.net/plug-ins/1.10.13/i18n/Polish.json"
        },

    });

Here is my custom filter:

    $('#status').on('change',function(){
        table
            .columns(4)
            .search( this.value )
            .draw();
    });

Use of chinese-string plugin for ordering

$
0
0

I suposse it must be trivial, but now i'm stuck. The question is how can i make use of chinese-string plugin for sorting special characters (with accents, pe.)?

I've seen the following plugin
//cdn.datatables.net/plug-ins/1.10.13/sorting/chinese-string.js

but the trials I've carried out have failed. Where (in the js code) must I apply or call this plugin?

A piece of my code, obtained using DTE Generator, is

```var table = $('#mytable').DataTable( {
    ajax: 'php/table.mytable.php',
    columns: [
        {
            "data": "user"
        },
        {
            "data": "name"
        },
        {
            "data": "group"
        },
        {
            "data": "phone"
        },
        {
            "data": "email"
        }

    ],
    order: [[ 1, 'asc' ]],```

if I try to apply the example to my own case:

$('#mytable').dataTable( { columnDefs: [ { type: 'chinese-string', targets: 0 } ] } );

It thows a "Cannot reinitialise DataTable" error.
Should I put it in the editor initialisation (var editor = new $.fn.dataTable.Editor...)?

Viewing all 81396 articles
Browse latest View live


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