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

Mulitple tables

$
0
0

Hello,

On my page I have 6 tables all with editor option. All these table receive its data from the same SP but the values in each table differs. After reading on the forum I saw that you need 1 instance for each editor table and since my tables contain different values I decided to create six instances of them as well. So I have

1
2
3
4
5
6

And I have six different JS files one for each table. I feel tho like this is really bad. First I created it as one table instance and took the class of all the tables like

$('.display').DataTable({

})

but with this method I had a hard time spliting the data from the ajax call to differ between table 1-6.

So my question is: If you have multiple tables that contain different values from the same datasource AND all shall be editable and be able to submit data to the db, is this the right way to do it?

I am asking this because it feels like I have to duplicate a lot of code which is obv bad. I just have a gut feeling that I am doing it in the wrong way.


Also, if this is the way to do it, is it possible to set stuff as paging,searching,processing,columns etc on class level?

Like I create a SixTableConfigFile.js and in it I can access all my table with class name and set default rules that are anyway same for all my tables.

$(.display).on('init.dt', function(){ //or something similar
paging : true,
searching : false,
processing : false
columns : myColumns
});

Br,
Anton


How to make header column resizeable with scrollX = true

How to return error message after canceling a preRemove server side event

$
0
0

Following the discussion:
https://datatables.net/forums/discussion/comment/114990/#Comment_114990

I can check the data and cancel the deletion of the row using "return false"

->on( 'preRemove', function ( $editor, $id, $values ) {
  $editor->validator( function ( $editor, $action, $data ) {
    ... some validator logic

    return false;

  } );
} )

I would like to have an example of how I can also return an error message...
thank you,

Jquery is not working?

$
0
0

I'm just like wtf.

I don't know. All I was trying to do is .css("font-size", "xx-small") and I realize I'm selecting... I don't even know what I'm selecting.

Can someone explain this picture to me?

Editor Format::dateFormatToSql when not setting all data

$
0
0

Dear all,

In Editor last version, in Editor/Format.php, beware if using dateFormatToSql with a format not including all date and time information: the function date_create_from_format is using the current time for missing data. It can create data inconsistencies.

For further versions, Allan, I suggest you add "!" in the following, as explained in http://php.net/manual/fr/datetime.createfromformat.php :
$date = date_create_from_format('!'.$format, $val);

Regards,

Gilles Boussin

Colvis (hidden columns by default)

$
0
0

I have ColVis checkboxes dropdown, I need to hide specific columns by default (need some specific checkboxes unchecked by default)

Here http://infra.clarin.eu/content/libs/DataTables-1.10.6/extensions/ColVis/examples/title_callback.html is what I can see but we don't have any such option to uncheck some of them.

I have tried to hide columns using "drawCallback" function using its settings parameter but no luck.

What should be the better approach, do we have any existing solution /api for this or we need to write a workaround?

Thank you for your help!

SearchDelay for Server-side issue

$
0
0

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

how to fill data in textbox inside datatables getting from dropdown during load using jquery

$
0
0

Hi everyone,
I have a datatable in which I have 2 columns. 1 is a dropdown and 2 is a textbox. I would like to set the all dropdown selected value in text box when loading in all rows.


How to show partial content for long text cells? Whole content is displayed if the cell is clicked.

$
0
0

One of my column is for long text content (for product description). In order not to increase the row height in the table, any way to show partial of the text and also show "read more" at the cell? The full content can be expanded if the cell is clicked. or hovered. Thank you.

Enter text into row, hit enter and go to the next row, same column

$
0
0

Hey. Wondering if you have something already built. I'm using something like https://datatables.net/examples/api/form.html. I have an onchange event that get's the data when changed and passes it to my DB. Instead of clicking on the next text box. I would like it to auto select the next row, same column input box

The datatable to be sorted based on the input text column on loading the datatable.

$
0
0

I have a datatable and while loading - I want the records to be sorted based on the input text box column value. Could you please help me with an example.

Note- While loading the datatable - I want the records to be sorted based on the input text values.

Update problem when using stateSave with serverSide

$
0
0

Dear Allan,

I have a datatable with a createdRow function which calls $("td:eq(1)", row).append(...)
It works perfectly with stateSave: true, OR with serverSide: true
However, when using stateSave AND serverSide at the same time, it works on very first webpage call (because cache is empty, so stateSave does not affect loading) and if I refresh the webpage, my custom HTML is no more visible. I need to change sorting, or change page, and come back to the first page to see my custom HTML. If I press F5, same problem occurs again and again.
Same behavior on Firefox and Chrome.

PS: I have tried to add something like table.rows( row ).invalidate().draw(); but it does solve anything, and prevents other pages to display the HTML: I suppose because this should not be called inside createdRow.

Do you have a solution?

Cannot edit fixed columns

$
0
0

We are using DataTable with Fixed Columns, Scroller, Editor and KeyTable with inline editing and using server-side rendering.

We are having an issue with being unable to edit any of the fixed columns (there are 6). When clicking into a fixed column cell, the orange editor outline appears but there is no cursor and cannot be typed into. If I click on the same cell again, it seems that sometimes I am editing the table underneath. We also have validation rules on these cells, and error message will sometimes cause the fixed columns and the table underneath to be misaligned.

Please let me know what is the best way to engage support for this issue. I tried re-creating our scenario on http://live.datatables.net/seweyepe/1/edit (this is in-work).

How to sort secondary column descending in multi-column sort

$
0
0

I'd like to have a column which is the secondary sort for any other column in descending order. In other words, when a user clicks on a column to sort, it, of course, sorts by that column first and then by that secondary column. The secondary column should always be in descending order. The one exception is where the secondary column becomes the primary column. Then it can either descending or ascending as normal.

Let me give you an example. Given a table with 5 columns (A,B,C,D,E), column B is the "secondary" column in question. I see how to set the initial sort order, so this is about sorting from user interaction. I set the initial sort order to descending for column B.

User clicks on Column C. The sort should now be C (ascending), B (descending).
User clicks on Column D. The sort should now be D (ascending), B (descending).
User clicks again on Column D. The sort should now be D (descending), B (descending).
User clicks on Column B. The sort should now be B (descending).
User clicks again on Column B. The sort should now be B (ascending).
User Clicks on Column A. The sort should now be A (ascending), B (descending).

Hopefully that made sense.

Default search input without quotes

$
0
0

Hi everyone,

When I try to search for Rio de Jan.. using the default search input, without quotes, it seems to ignore the Rio de phrase, and considers only the last word Jan.
I have to put the query terms into quotes ( "Rio de Jan...") to work. Is there any setting that allows the quote query to be the default one?

Thanks,

Guilherme


Making table elements (from JSON) linkable

$
0
0

Hi---I have a JSON file that contains document titles and a URL for each. So far I've been able to render each document into my table. I also rendered each url into the first table row as a test. It was good that they appeared but it's not what I'm going for.

How can I make it so that each document title is linked with its respective URL? I didn't see any info. about it in the manual or the forum so I thought I'd ask.

If you'd like to see a snippet of the JSON file, please let me know.

JS snippet:

import $ from 'jquery';

import JSONfile from '../../../public/JSONfile.json';
import { basename } from 'path';

import dt from 'datatables.net';`

var tableRes = '';

    export default class {
        constructor() {
            this.loadData();
            this.loadTableData();
        }

 loadTableData() {
    $.noConflict();
    let tableRes = JSONfile.d.results.filter(function(val) { 
      return (val.FileLeafRef.trim().length > 0);
    }).map(function(obj) {

      return {
        // "FileName": obj.FileLeafRef,
        // "Path": obj.EncodedAbsUrl, ///// these are the URLs for each document
        "Titles": obj.File.Name
        }
      });

    $('#km-table-id').DataTable( {
      columns: [
        { "data": " " },
        { "data": "Titles" }, ///// Ideally I want each Title to be linked in the table---i.e. the document names appearing blue
        { "data": " " }
      ],
      data: tableRes,
      "pagingType": "full_numbers"
    });

 }

}

Hide the sorting option on all but one column?

$
0
0

I'd like to default sort a column (know how to do this) AND hide the sorting option on my other columns. Is this possible with DataTables? I can't find the option.
Thanks!

Basic understanding of API — table.$('td').addClass('tablecell');

$
0
0

Can someone explain why the second to last line here does not add a class of 'tablecell' to all my <td> elements?

$(document).ready(function() {
    var table = $('#ratings-table').DataTable({
        "ajax": 'table_senate_info.json',
        "columns": [
            { "data": "ratingPhrase" },
            { "data": "state" },
            { "data": "fullName" },
            { "data": "trump_margin" },
            { "data": "firstName" },
            { "data": "lastName" },
            { "data": "raceRatingID" },
            { "data": "open_seat" }
        ],
        "columnDefs": [
            { targets: [4, 5, 6, 7], visible: false },
            {
                "targets": 2,
                "render": function(data, type, row) {
                    return data + ' (' + row.open_seat + ')';
                }
            },
            { "orderData": 5, "targets": 2 },
            { "orderData": [6, 5], "targets": 0 }
        ],
        renderer: "bootstrap",
        responsive: "true",
    });
    table.$('td').addClass('tablecell');
});

Problem in AJAX POST order variable if serverSide is true and no order setup

$
0
0

Dear Allan,

If no order variable is setup, and despite the first column is setup with orderable at false, then the POST order variable indicates by default the column 0. If the column is a technical column not binded to the database, eg. to handle checkbox for selecting rows, then AJAX answers an error "unknow field" on column 0.

I have setup an order in all cases to avoid this problem.
However this is a bug that may create real problems. You can patch it with sending null and avoid any order in this case in PHP, or with a loop in javascript to take the first orderable column instead of 0.

Hoping this report helps.

Regards,

Gilles

Sports Grass For Football

$
0
0

HISOA Sports grass for football has an even olive green colour. It's a sand filled type of artificial grass,Website:http://www.hisoa-grass.com, which means that the turf has to be provided with a layer of sand.Technical Parameters Of Sports Grass For FootballProduct ModelFD140-36050/20Fiber CompositionMonofilament Fiber: PEYarn ShapeFlatPile Height(mm)50mmGauge (inch)3/4Stitches Rate200Density/sqm10500Grass Life5-8 yearsPrimary Backing Composite PP woven fabricSecondary BackingMesh fabricCoating BackingSBR LatexDiameter of Drainage Holes(mm)5Roll Length (m)25 or customizedRoll widths (m)2 or 4 Loading quantity 2200-2500 sqm/20GP4500-4600 sqm/40GP4600-5000 sqm/40HQInstalling AccessoriesJoint tape, Adhesive glue ApplicationSports grass for footballWhy Choose HisoaExtensive production experience: we are specialized in landscaping artificial grass, sports field artificial turf with an experience of more than 10 years.Stable quality and on-time delivery: With our own factory, HISOA can control the quality from raw material to each production process. What’s more, we have some stock on the popular items, which means we can meet your urgent need and can guarantee the delivery time.Superior production equipment: we own precision tufting machine controlled by computer system, drying tunnel for coating, and other advanced equipment. Our technicians will do regular scheduled maintenance on these machines to ensure them work well.Advanced coating technique: HISOA owns the most advanced techniques of coating in China, Latex and PU coating. After more than 10 years research and development of coating, we apply unique technique to improve extraction rate at least 70N. HISOA owns high evaluation among the artificial grass industry.Rigorous testing procedures: To meet the requirements of the product design and process, we provide reliable testing data including lisport test, tuft withdrawal force test, buffering test, etc. Production Equipment

Viewing all 81388 articles
Browse latest View live


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