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

Editor dealing with a jSON field that is a sum of two table Fields

$
0
0

Okay, so I'm planning to add the php editor library to my editors instance. The table I want to be able to modify receives an ajax call that contains some JSON fields that are basically sums of two database fields. Can editor handle that?


Anyone used a carousel within a datatable.

$
0
0

I have images and videos that I would like to show in a carousel.

Is it possible to use render to populate a carousel. So instead of the client having to scroll down a cell then can use the carousel.

Any ideas or links appreciated please.

Cheers

Steve Warby

Export to excel/csv with footer

$
0
0

How can we export data in datatable to excel or csv format which includes footer information also. Currently, footer gets exceluded. However, on setting footer as true for pdf I am able to get in PDF format.

PDF FOOTER EXPORT WORKS:

                        extend: 'pdfHtml5',
                        footer: true

EXCEL / CSV FOOTER EXPORT DOES NOT WORK tried setting footer same as above for extend: 'excel'

too SLOW issue

$
0
0

I got a 10M entries table. Even with Server-side processing. It takes more than 30 seconds to show the Next page (10 entries). Any ideal why? any solutions?

use Excel and print with external button

$
0
0

hello alan

i want to export data using excel and print ...
so how can i print and export data by using another customised button without using data-table toolbar print and excel button...
i need to use as like add /edit /duplicate with external hyperlink refren

<a class="editor.create"></a>

regards
karthik.r

Auto refresh datatable

$
0
0

hi i am still a beginner in coding, help me how to make auto refresh datatable every 1 sec without eliminating the order function... Please give me example. Thanks

Sorting Column.. showing previous data on datatable while processing

$
0
0

I am using server side data table using ajax.

I am populating datatable from ajax request . So issue is as on following steps

1. Populated datatable with on resultset. Table is drawn with resultset1

2. Again Some custom search and populating datatable with resultset2.

3. When clicking on Column for sort.

  while processing its showing resultset1 data on datatable.

4. After sort processing complete it shows sorted result with resultset2.

Not sure why #3 is happening. Its working fine while pagination no issue like sorting process. Please suggest. really appreciates any help and support.

Uploading a PDF file.

$
0
0

I have generated a table using the online generator and am now trying to adapt it so that I can upload a PDF file, but at the moment, it will only accept image uploads. Am I missing something.?

**PHP**
            ->upload( Upload::inst( $_SERVER['DOCUMENT_ROOT'].'/upload/__ID__.__EXTN__' )
                ->db( 'files', 'id', array(
                    'filename'    => Upload::DB_FILE_NAME,
                    'filesize'    => Upload::DB_FILE_SIZE,
                    'web_path'    => Upload::DB_WEB_PATH,
                    'system_path' => Upload::DB_SYSTEM_PATH
                ) )
                ->validator( Validate::fileSize( 500000, 'Files must be smaller that 500K' ) )
                ->validator( Validate::fileExtensions( array( 'png', 'jpg', 'gif',pdf' ), "Please upload" ) )
            )

    )
    ->process( $_POST )
    ->json();


**JS**
              {
                data: "file",
                render: function ( file_id ) {
                    return file_id ?
                        '<img src="'+editor.file( 'files', file_id ).web_path+'"/>' :
                        null;
                },
                defaultContent: "No image",
                title: "Image"
            }

Datatables 1.10+ & ASP.NET MVC 5 with Server Side Integration

$
0
0

I recently had to convert a ColdFusion application to ASP.NET MVC 5 application.

As I am fairly new to ASP.NET, this post was a time saver:

https://echosteg.com/jquery-datatables-asp.net-mvc5-server-side

This project uses samples of the original code created by Marien Monnier (French to English):

https://translate.google.com/translate?sl=fr&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fblog.goood.pro%2F2014%2F11%2F21%2Fmvc-utilisation-de-jquery-datatables-en-mode-serveur%2F&edit-text=

How to deselect a row after editing it

$
0
0

I need to deselect a row after successfully editing it. I made a handler for the 'submitSuccess' event, but I have not figured out how to refer to the row that was just edited, which is still selected.

I think I need to use row().deselect(), but I haven't figured out how to refer to the currently selected row, the one that was just edited.

Thanks,
Tom

Datatables does not responding to search() method

$
0
0

Hi everyone,

I am working with .search() method in Datatables. Currently I am using it to look for a value in row 0 when a user clicks on a defined buttom. However, when user clicks on this buttom and he wants to go back to watch all table entries again (deleting input text in search box), Datatables does not draw all entries. Here is my code:

regExSearch ='^'+event+'$';

// Place the value into the datatable input filter and set focus there.
var tableInput = $('#tableID_filter > label > input').get(0);
$(tableInput).val(event);
$(tableInput).focus();

// Apply the match case (with regex) search manually.
var table = getDatatableInstance('#tableID');
table.column(0).search( regExSearch, true, false ).draw();

And JS code:

$(div).dataTable( {
    "responsive": true,
    "data": dataSet,
    "lengthMenu": [[5, 10, 50, 100, -1], ['5', '10', '50', '100', gettext('All')]],
    "bSort": sortable,
    "order": [[ 0, "asc" ]],
    "pageLength": pageLength,
    "columns": columns,
    "columnDefs": [
        {
            "targets": columnsToHide,
            "visible": false,
            "searchable": false
        }
    ],
    "buttons": [
        {
            "extend": 'csv',
            "name" : 'csv',
            "exportOptions": {
                "columns": columnsToExport
            }
        },
        {
            "extend": 'pdf',
            "name" : 'pdf',
            "exportOptions": {
                "columns":  columnsToExport
            },
            "orientation": orientation
        }
    ]
});

The rest of Datatables are responding correctly so I don't know why when an user dele the search text from input box, datatable does not draw all entries again.

I noticed that if I delete .column(0) from search everything goes nice. So the problem exists just when .column(0) is used.

Could someone help me?

Thanks beforehand.

Regards, Mike.

Editor Template CSS Styling

$
0
0

Hi,

Do you have a cheat sheet describing the Editor Template CSS Styling?

Thanks,
Thomas

hide sort icon when col orderable=false

$
0
0

Hi folks,

The first column of my table is a checkbox with no column label and no visible data. I would like to hide the sort arrow because it essentially doubles the width of the column. How can i do this?

~ Justin

Button enabled if multiple rows selected

$
0
0

There seems to be no equivalent of

extend: "selectedSingle"

to enable a button only if more than one row is selected. I'm guessing there's a work-around, but I haven't figured it out.

Search for data table is very slow

$
0
0

We are using data table for displaying data wit 7000 rows of data and 60 columns with multi select drop down option for individual columns, when we are searching in the data table it is taking so much time for filtering, if their are any other ways to speedup the search and data loading into the data table please inform. Thank you in advance.


[server-side + http-custom] update datable result with custom value using external input.

$
0
0

hi,

I want upate my datable using an input

i have an input with button
```html
<input id="itexte" type="text"></input>
<br>
<input id="soumission" type="button" value="le bouton"></input>
<div class="container">

```

my datatable contain :

```js
data: function ( d ) {
d.city = $('#itexte').val();
}

```

i try :

$( "#soumission" ).click(function() {

    table.ajax.reload();

});

but it's doesn't works

Function visible() - Very slow

$
0
0

Hi team,

I'm working on a dashboard interface with dataTable in ajax. I created a form with a select list to select the columns (80+ columns) what you want to show.
The PHP ajax check the columns to show, the rights on the columns and the xhr ajax return dataTable datas and the columns to show/hide.
The ajax call response in 370ms (50 rows) but the draw of table is during 4/5s. I desactivated my each on the visibility and the draw of table is instant.

Does the visible function have performance issues? I created this exemple on jsFiddle: https://jsfiddle.net/m45gy64c/5/ to show the problem.

Buttons not displaying

$
0
0

Sorry in advance to ask a very common newbie question, but I did search the forums and didn't find anything that helped.

In an attempt to figure out why my buttons are not showing, I put together a very simple client-only HTML page, shown below, and am running it in Internet Explorer 11. I also confirmed that the following files (among many others) are present in directories underneath the location of the HTML page:

  • Scripts/jquery-3.1.1.js
  • Scripts/DataTables/jquery.dataTables.js
  • Scripts/DataTables/dataTables.buttons.min.js
  • Content/DataTables/css/jquery.dataTables.css
  • Content/DataTables/css/buttons.dataTables.min.css

The rest of the table functionality is working fine, it's just that the buttons are not showing. Any troubleshooting ideas are greatly appreciated.

P.S. Regarding the DataTables debugger, it's not clear to me how to use this with IE 11, since its debug console does not give me an opportunity to paste anything into it. I also searched for and couldn't find any further information on that in the forums.

<!DOCTYPE html>
<html>

<head>

    <!-- jQuery -->
    <script type='text/javascript' src='Scripts/jquery-3.1.1.js'></script>

    <!-- JS/CSS library for jQuery.DataTable -->
    <script type='text/javascript' src='Scripts/DataTables/jquery.dataTables.js'></script>
    <link href='Content/DataTables/css/jquery.dataTables.css' rel='stylesheet' type='text/css' />

    <script language="javascript" type="text/javascript">

        $(document).ready(function () {

            $('#MyTable').DataTable ({
                order: [[1, 'asc' ]],
                dom: 'Bflrtip',
                buttons: [ 'csv', 'excel' ]
            });
        });

    </script>

</head>

<body>

    <h1>Export Test</h1>

    <div style='width: 400px;'>
        <table id='MyTable' style='border: 1px solid black;'>

            <thead style='background-color: #DDD;'>
                <tr><td>ID</td><td>First</td><td>Last</td></tr>
            </thead>
            <tbody>
                <tr><td>1</td><td>Carol</td><td>Morin</td></tr>
                <tr><td>2</td><td>Jason</td><td>Toothaker</td></tr>
                <tr><td>3</td><td>John</td><td>Brooking</td></tr>
                <tr><td>4</td><td>Isaac</td><td>Oyinlade</td></tr>
                <tr><td>5</td><td>Rob</td><td>MacDonald</td></tr>
            </tbody>
        </table>
    </div>

</body>
</html>

Can I persist the state of check boxes?

$
0
0

I have a check box in each row of my table (which serves as a checklist). And I need to be able to persist the value of each check box. I've tried stateSave, but that doesn't appear to work for check boxes.

My data is in a local JSON file (an array of objects). Is there an easy way to save this state?

Does Editor support "Edit" / "New" with multi-level joins where some elements of the join are empty?

$
0
0

I have just started using Datatables and Editor so I apologise if this seems obvious.

I have a db structure that is similar to:
t1.id
t1.t2id
t1.data

t2.id
t2.data

t3.id
t3.t2id
t3.data

And display in Editor
t1.data, t2.data, t3.data

which seems to work as expected. However, if I try inline edit t2.data or t3.data for a row where t2 and t3 do not exist I get the error:
An SQL error occurred: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

Is this expected? What is the sop to create rows where they do not exist?
(P.S. This error also occurs when using the new pop-up)

Viewing all 81688 articles
Browse latest View live


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