Are you the publisher? Claim or contact us about this channel


Embed this content in your HTML

Search

Report adult content:

click to rate:

Account: (login)

More Channels


Showcase


Channel Catalog


Channel Description:

Recent Discussions — DataTables forums

older | 1 | .... | 2251 | 2252 | (Page 2253) | 2254 | 2255 | .... | 2326 | newer

    0 0
  • 11/08/18--01:33: show data of two columns
  • I need to show the data of two rows in the editor. The two examples did not help me, because I need both row Data for a compare and Merge. In my case I would see on the left side row1 and on the right side row 2. how can I do this?

    Andreas


    0 0

    Hi

    I am new to used datatables.

    I have query that if i have 1000000 records loaded in datatable using server side processing.

    But its take time for searching. Also if array pass to the datatable having data from two queries then searching is not possible on both queries. And if query has aggregate function then sorting is not possible.

    Please help me for the same.

    Thanks in advance


    0 0

    We need to convert a datetime field form ISO format to DD/MM/YYYY and back to ISO format when the edit are saved.
    We have the following issues:
    1) it seems that the format option does not convert at the first render of the edit form but only after the value has been edited
    2) when the data are saved it seems there is not an option to convert back to ISO format

    For in line edit, we do not have any issue because we use use a prorpietary render() function for type='display'


    0 0
  • 11/14/18--01:27: DataTables - Symfony 4
  • Hi
    I'm using datatables together with Symfony 4 and this works great.
    I was now wondering, as I fill my table with data from my MySQL DB, if I could limit the display to as example 50 entries but when I use the search he's going to look in all the data?
    As I work on a project where there are very fast thousands of entrires I'm afraid that everything would get very slow for that.
    Or does anyone use datatables with that many informations in it and can tell me about the speed?
    Many thanks already :)


    0 0
  • 11/15/18--02:55: Dropdown with editor
  • I knew that there is an example of this in this: https://editor.datatables.net/examples/inline-editing/join.html
    But it uses join of the tables where all dropdown having the same values.

    I want to know if there are any other examples where all the dropdown has different values.
    It will be good if the values of the dropdown are filled by the response of json (no use of join).


    0 0

    Hello,

    my export buttons were working, but I added the AdminLTE bootstrap and they stopped working. Are they in conflict with any adminlte scripts?

    My DataTables scripts in the template header:

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
        <script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.5.1/js/dataTables.buttons.min.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.flash.min.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.print.min.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.16/api/sum().js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    

    Some more AdminLTE DataTables scripts:

     <link rel="stylesheet" href="{{ asset('admin-theme/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') }}">
     <script type="text/javascript" src="{{ URL::asset('admin-theme/bower_components/datatables.net/js/jquery.dataTables.min.js')}}"></script>
        <script type="text/javascript" src="{{ URL::asset('admin-theme/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js')}}"></script>
       
    

    B is included in DOM

         dom: 'Blfrtip',
                                        lengthMenu: [[10, 25, 50,100,200,300,400], [10, 25, 50,100,200,300,400]],
                                        buttons: [
                                            'copy', 'excel', 'pdf'
                                        ],
    

    0 0
  • 11/15/18--03:32: formatter php problem
  • Hello,

    I have this php code that works:
    .....
    array( 'db' => 'ora_extragere', 'dt' => 1,
    'formatter' => function($ora_extragere) {
    $ora_extragere = date('H:i', strtotime($ora_extragere .' +1 hour +0 minutes'));
    return $ora_extragere;
    }),
    .....

    But this not work:

    $rule="+1 hour +0 minutes";
    .....
    array( 'db' => 'ora_extragere', 'dt' => 1,
    'formatter' => function($ora_extragere) {
    $ora_extragere = date('H:i', strtotime($ora_extragere .' '.$rule.''));
    return $ora_extragere;
    }),
    .....

    Why?

    Thank you.


    0 0

    Hi,
    My table column number will be different from case to case (depending on the month amount per case). And I am not sure how to include those months data with data tables. So I created a table and populated it from the model.

    table id="MyTable"class="display row-border" cellspacing="0" width="100%">
                            <thead>
                        <tr>
                            <th>Name</th>
                            <th>Gender</th>
                            @foreach (var M in Model.MonthsCounter)
                            {
                              <th>@M.Month-@M.Year</th>   
                            }
                        </tr>
                    </thead>
                            <tbody>
                                @foreach (var item in Model.Data)
                                {
                                    <tr>
                                        <td>@item.Name</td>
                                        <td>@item.Gender</td>
                                        @foreach (var record in item.values)
                                        {
                                            <td>@record.Value</td>
                                        }
                                    </tr>
                                }
                            </tbody>
                        </table>
    

    I was wondering if its possible to add columns data from a loop... somethig in the idea of this :smile:

     { "data": "Name", "autoWidth": true, "visible": false },
     { "data": "Gender", "autoWidth": true, "visible": false },
    // someway to loop over data
      foreach (var item in data)
    {
    
    {"data": item,"autoWidth": true, "visible": false }
    
    }
    

    I understand its possible with "Editor" by using .Add, but for few more weeks i have to postpone purchesing Editor, so i was wandering if it can be done with datatables.

    BR,


    0 0

    Hello,

    I have an editor that's displayed on the page using the onPageDisplay function. Some of the fields are select2 objects using ajax as data source.
    When the form is shown, I see 2 initialValue requests for each of the select2 fields ("http://localhost:53686/Registraties/getOptions/TYB?initialValue=true&value=%22%22"). Is this to be expected?
    (Sorry, but I can't make this accessible online to debug...)

    The form is shown as follows:

            editor
                .buttons({
                    label: "Save",
                    fn: function () { this.submit(); }
                })
                .create(1, true, {
                    focus: null
                });
    
    

    Example of a select2-field definition:

                    {
                        "label": "type behandeling",
                        "name": "TYB",
                        "type": "select2",
                        "opts": {
                            placeholder: '...',
                            ajax: {
                                dataType: "json",
                                url: '/Registraties/getOptions/TYB',
                                data: function (params) {
                                    return {
                                        productid: ProductID
                                    };
                                },
                                processResults: function (data) {
                                    return {
                                        results: data
                                    };
                                },
                            }
                        }
    
                    }
    

    0 0
  • 11/15/18--07:05: Create test case for editor
  • Hi
    Is it possible to build a test case for editor with the ajax /ssp/staff.php
    If so what link should we use into http://live.datatables.net

    Thanks


    0 0

    Utlizing the API function myTable.init() I am able to retrieve most of what the original configuration settings of a table are.

    but I've noticed .init() returns what ever the current sort order on the table is not the original sort order that the table was created with.

    Where is the original story order stored.
    Or do i need to grab it during table init and save it as it's own property.

    Example

    My Orginal dataTable Config object

    {
            columns:moveReqCol,
            data: dataTableJSON,
            scrollX: true,
            stateSave: true,
            deferRender: true,
            colReorder: {realtime:false, fixedColumnsLeft:2},
            fixedColumns:   {
                leftColumns: 2
            },
            dom: 'Blfrtip',
            order: [[ 1, "desc" ]],
        }
    

    notice i have 1 order set.

    now, after setting an order on the table the .init() function returns.

    {columns: Array(17), data: Array(87), scrollX: "100%", stateSave: true, deferRender: true, …}
    aaData: (87) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
    aaSorting: (4) [Array(2), Array(3), Array(3), Array(3)]
    aoColumns: (17) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
    bDeferRender: true
    bDestroy: true
    bStateSave: true
    buttons: ["test"]
    colReorder: {realtime: false, fixedColumnsLeft: 2}
    columns: (17) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
    data: (87) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
    deferRender: true
    destroy: true
    dom: "Blfrtip"
    drawCallback: ƒ ()
    fixedColumns: {leftColumns: 2}
    order: (4) [Array(2), Array(3), Array(3), Array(3)]
    sDom: "Blfrtip"
    sScrollX: "100%"
    scrollX: "100%"
    stateSave: true}
    

    we can see that the order has updated to what ever i've currently set it to.

    I've Attached a jsFiddle below that console logs what im talking about.

    http://jsfiddle.net/3yxr2mv9/


    0 0

    Hi,

    I am trying to add a spinner at the bottom of the dataTable ( inside the dataTable )until the data table completes appending the result's row wise on success of the each ajax call. I have seen lot of examples where the dataTable shows "Loading/Spinner" . But in my case I am adding the rows to the dataTables. Meanwhile till the ajax requests is compete i wanted the spinner at the end so that results are visible to the users dynamically.


    0 0
  • 11/15/18--06:37: Scroller with responsive
  • Hi
    what about scroller extensions togheter with responsive. The scroller seems not to adjust its measure on responsive dsplay when the scrollCollapse option is set to true.
    Is it the standard behavior? Or should the scroller change on responsive opening and closing?

    Thanks
    Monica


    0 0

    I'm using Visual Studio 2017 Editor_Net_Core_Demo and I'm looking at the bubble editor Example. When I look at the simple.html, the route for the editor is api/Staff, as it the route for a lot of the demos. I'm not that familiar with ADO.Net, but I can see that the controller is just grabbing the data from the database and sending back a Json response. I have a question about this.
    1. When I edit using the bubble editor, it calls the same url in the same controller, which takes no parameters. So the question is, how does the database get updated? I would have expected the editor to use a different url than the table and for that url to take a parameter with the edited data and then do a database update.


    0 0
  • 11/15/18--08:14: custom positioning
  • I have some confusion in regards to custom positioning of DT-specific elements. Currently, in init js section, I have something like this:

    dom: 'lBfiptip'

    so, prior to table, I have dropdown list (how many rows), set of buttons (column visibility groups), filter, info and pages. After the table, I have again, info and pages.

    I understand, that changing order of these letters, changes order of displayed elements. But visually, the resulti is not what I expected. So here is my question.

    If prior to data table, I create some 'custom table' - can I somehow assign individual DT elements to individual table cells?

    [I don't exactly understand the manipulations, that are made in dom secion in other examples.]

    Can I see some example, how this can be done?


    0 0

    In my setup, I have dropdown list (for how many rows per page), custom buttons (column visibility groups), filter, info, and pages.

    Is there a quick/simple way, to set fonts and button sizes (margins around the text?), so that these elements share the same theme, specified for other data in my document? A sort of global formatting presets, assigned to selected elements.


    0 0
  • 11/15/18--08:28: custom paging
  • Paging contains limited amount of numbers.

    Is it possible to specify/define a set, that shows all numbers? I didn't found it, or misunderstood something.

    I'm displaying 1 row per page, with customized display of columns, each row contains few long sentences of text.


    0 0

    Hi guys

    Hope you can help me. Im using the table responsive. it wraps long variable data value, but for numeric value it doest wrap. Please advise. thanks


    0 0
  • 11/15/18--08:31: Misalign column when sorting
  • Hi guys

    Hope you can help me again. my datagrid is misalign when clicking sorting or next button. how to fixed it with same width for every pages. Even clicking next or previous or pagination the columns are misalign.

    Thanks in advance ☺


    0 0

    Hi,
    I'm trying to implement the colReorder function along with order and colVis functions.

    Problem is that if I move a column, the indexes returned from order or colvis functions is the original one and not the actual one.

    For example, consider a table with 3 columns (id 0, 1 and 2), column 0 contains internal data so it's hidden by default and not considered in the colVis columns, I order column 2 and then switch it with column 1:
    - before moving column, table.settings().order() returns [ 2, "asc" ]
    - after column has been moved i expect to receive [ 1, "asc" ], but I get [ 0, "asc" ]

    So, if I save table.settings().order()'s result to the database and then use it back on next table initialization, everything is messed up. I've menaged to solve this replacing the returned index with table.colReorder.transpose(idx) in a for cycle, but is this really the way to go?

    With colVis is even worst and I don't even know how to work around it. In the same scenario as above, if I select from the dropdown menù the column number 2, it remains visible, column 0 becomes visible between column 2 and 1, column 1 remains visible.
    I've set up a demo for you: https://jsfiddle.net/0yc8sd1z/. Please, switch the 2 columns and then try to hide the column "Office".


older | 1 | .... | 2251 | 2252 | (Page 2253) | 2254 | 2255 | .... | 2326 | newer