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 | .... | 2262 | 2263 | (Page 2264) | 2265 | 2266 | .... | 2326 | newer

    0 0

    Hi All,

    I've been played with the checkbox styling inside of dataTable but with no much success.

    Have anyone changed the style, like size and some other effect for the checkboxes inside of the dataTables?
    Centralize vertically and horizontally?

    For example: I would like to add this style for my checkboxes, but, I'm not sure of the limitations and possibilities when customizing that

    Style sample: https://codepen.io/CreativeJuiz/pen/BiHzp

    Thank you very much in advance!

    Regards,
    Alex


    0 0
  • 11/21/18--08:27: insert data in 2 tables
  • Hello everybody.
    I have 2 tables T1 and a t2 linked by a foreign key T1_fk_t2.
    I create an editor form on my T1 master table with some fields of my t2 table.
    I want to be able to create a new record in the my 2 tables from my T1 editor form.
    I thought to use an event like .on('preCreate' in my js file or ->on( 'preCreate ' in my php file to creta the row in my t2 table before create row in T1 table.
    But every time i have this alert "Foreign key violation: 7 ERREUR: une instruction insert ou update sur la table « T1 »" because the record in my t2 table is not created before.
    How can i do this. I really want to use the T1 editor form and only one submit button.
    Thanks for your help.
    Lionel


    0 0

    I have implemented data tables (1.10.13) and used buttons.HTML5 , dataTables.buttons.min(1.2.4) plugin to export pdf,csv functionality.

    I am facing one issue like, in Some of IE Browsers PDF or csv working fine (IE 11 Update version 11.0.40 or greater and less than 60). where as pdf or csv is not exported properly in IE Update base verison i.e, 11.0.7 or less than 11.0.40 and greater than 11.0.60 for ex: 11.0.80. Export pdf of csv is not working. I am getting message PDF/csv couldn't be downloaded issue.

    is it IE issue or the library is not supporting export?

    Regards,
    Suresh V


    0 0

    Hi everyone,

    I just wanted to ask if ist possible to put the select fields not for every column. In the example from DataTables, there is the table columns.each function but I just Need the select Input for 4 Columns..
    Can you guys help me out?
    Cheeres, Mert


    0 0

    I cannot for the life of me figure out how to remove the "print" button from my table. Any ideas? Thanks


    0 0

    Hi Allan & All,

    My table is on automatic ajax reload every 3 seconds. Selected cell border disappeared though broswer did save it's location. When I use my arrow keys, it got activated to navigation again. But it will disappear again every 3 seconds.

    I turn off the state saving for a reason. I would like to keep (show) the selected cell (only the cell selected; not filter or page) showing after ajax reload.

    What is the syntax I could add to the refreshTable() function?

    File: js/table.YourTableName.js

    var table = $('#cargoes_lr2').DataTable( {

    table.keys.enable();
    
    var timer;
    
    function refreshTable(){
        timer = setInterval( function(){
            table.ajax.reload( null, false ); // user paging is not reset on reload
        }, 3000 );
    
    };
    

    -- end --

    Thank you!


    0 0

    I have defined a function 'formatPrice' in accountJS file, which I want to call while binding jquery datatable in a partial view.Along with that I want to pass the value to this function @item.price. Below is the code, where I am not getting how the "accountJS.formatPrice" function to be called

        @model List<Products>
    
            <table id="datatableResult" class="searchgrid">
            <thead>
            <tr>
                <th>Id</th>
            </tr>
            <tr>
                <th>Product Price</th>
            </tr>
            </thead>
            <tbody>
            @if (Model != null)
            {
                 foreach (var item in Model)
                {
                  <tr>
                     <td>@item.Id</td>
                     <td>>! accountJS.formatPrice(@item.price)</td>
                  </tr>
                }
             }
            </tbody>
            </table>
    

    0 0

    Hi have a custom display controller that renders the editor after the last row in the datatable:

    (function(window, document, $, DataTable) {
    
    
    var self;
    
    Editor.display.inline = $.extend( true, {}, Editor.models.displayController, {
        /*
         * API methods
         */
            "init": function ( editor ) {
                
                return self;
            },
    
            "open": function ( editor, append, callback ) {
                
                
                
                var table = $(editor.s.table).DataTable();
                
                var row = table.row(':last');
                //var row = editor.s.modifier;
    
                if (self._shown == true) {
                    // Close any rows which are already open
                    Editor.display.inline.close( editor );
                    self._shown = false;
                    return;
                }
    
                // Open the child row on the DataTable
                table
                    .row( row )
                    .child( append )
                    .show();
    
                $( table.row( row ).node() ).addClass( 'shown' );
    
                if ( callback ) {
                    callback();
                }
                
                self._shown = true;
                
                
            },
    
            "close": function ( editor, callback ) {
                var table = $(editor.s.table).DataTable();
    
                table.rows().eq(0).each( function ( idx ) {
                    if ( table.row( idx ).child.isShown() ) {
                        table.row( idx ).child.hide();
                        $( table.row( idx ).node() ).removeClass( 'shown' );
                    }
                } );
    
                if ( callback ) {
                    callback();
                }
            },
            "_shown": false
            
    } );
    
    self = Editor.display.inline;
    
    }(window, document, jQuery, jQuery.fn.dataTable));
    

    How can I:

    a) Remove the bootstrap header from the editor? <div class="DTE DTE_Action_Create">
    b) Add a close button next to the create button?


    0 0

    I have datatable where it holds many columns with decimal values. my application is being used by German users.

    Here is a small example where I have an issue.

    A B
    70.000,00 700,00

    When I export this datatable using excel export, I am getting the below result.

    A B
    -- ----
    70.000,00 70000

    Here I am getting incorrect value in B column . It is not treating , as decimal where as it must be in German Format. Instead it is treating it in English format and showing it as 70000 instead of 700. Somehow unfortunately column A is showing with an error and hence it is not changing the format. Please help me here how can i fix this issue.


    0 0
  • 11/22/18--02:15: 如何禁止表格拖拽
  • 怎么样可以禁止表格拖拽


    0 0

    I am trying to merge cells in custom added header while exporting the data to excel file. I can see merge cells function in buttons.html5.js. But really i don't get any clue to implement this in my project. can anyone please explain me how to achieve this?

    Thanks,
    Satheesh


    0 0

    $(document).ready(function () {
    $.ajaxSetup({
    cache: false
    });
    var gender = null;
    var table = $('#studentTable').DataTable({
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "studentService.asmx/GetStudents",
    "fnServerData": function (sSource, aoData, fnCallback) {
    aoData.push({ "name": "gender", "value": gender });
    $.ajax({
    "dataType": 'json',
    "contentType": "application/json; charset=utf-8",
    "type": "GET",
    "url": sSource,
    "data": aoData,
    "success": function (msg) {
    var json = jQuery.parseJSON(msg.d);
    fnCallback(json);
    $("#studentTable").show();
    },
    error: function (xhr, textStatus, error) {
    if (typeof console == "object") {
    console.log(xhr.status + "," + xhr.responseText + "," + textStatus + "," + error);
    }
    }
    });
    }
    ,
    "aoColumnDefs": [
    { "aaSorting": ["desc", "asc"], "aTargets": [0] }
    ]
    ,
    "aoColumns": [
    { "aaSorting": ["desc", "asc"] },
    null,
    null
    ]
    , fnDrawCallback: function () {
    $('.image-details').bind("click", showDetails);
    }
    });
    });


    0 0

    I would like to be able to reset all the values in individual column search inputs at the click on a custom 'Reset' button in the table. Could you suggest me how to obtain this behaviour ? TIA


    0 0
  • 11/22/18--03:14: Allocation of row ids.
  • I'm not crystal clear on how row ids are allocated by DT.
    Is it the case that, if my table initialisation includes an explicit definition (e.g. rowId: "song_id"), then whenever that table is in play the numeric part of rowId is guaranteed to be the song_id?
    That's the way it looks, but I want to be sure. I'm asking because I need more aspects of my app to become generic, and using row ids is a significant step.


    0 0
  • 11/12/18--02:13: Problem with the line break
  • Good morning
    In Datatable by default, the text that we write in a text with paragraph breaks, is shown in the table continuously. In the Database, PhpMyAdmin is written correctly, but there is no problem with the editor. There is a way to change this property and to show it as it is written.
    In the example:
    This is an example.
    Second line.
    Third line
    Appears
    This is an example. Second line. Third line
    Thank you


    0 0

    I have a lot of data that needs to be put in the datatable. The code was written long back that rewriting the code will be a huge task for me to add server side pagination.
    So I had applied a filter 'Sub Brand' so that I can reduce the count of data coming in the UI.

    The count of data reduced significantly by the ratio, but still there were 2088 data that needs to be populated in the datatable.
    However, 2088 was still taking a time of almost 8-10 seconds.

    I tried improving the SQL query so that I can just fetch whatever data I need for the particular page. Even though the query executed faster than before, the time taken for the UI to load is still the same, without any significant change.

    Could you suggest me a solution for this, excluding server side pagination for now?
    If there are no other solutions, that's the one I will probably have to go ahead with, but considering the time and testing it requires, I'm not really sure if my colleagues would suggest that way.

    Thanks!


    0 0

    1.- We have a Datatable getting data from a server, with some visible columns and some hidden columns.
    2.- All columns have a built in search field to filter rows.
    3.- Then I use some search fields to filter the results. Every thing works as expected.
    4.- Then I unhide some previosly hidden column. Every thing works as expected.
    5.- Then I try to use the built in search field of this unhidden column and this column is populated by the contents of the next column. In other words, if I unhide column 4 and then try to filter by this column, column 4 is populated by the content of column 5 and column 5 keeps the proper value.

    Is there any thing I am forgetting to switch off or on??


    0 0

    Hi,

    I'm having an issue
    I have a lot of columns let say 15
    I'm using responsive
    I'm using savestate
    When using the main search let say I search for John
    Then I go to another page and get back, the result is ok and still there
    Now if I clear the search field
    Then the columns are not well aligned they are a little bit outside the template
    If refresh the page this is ok.

    This occurred only if I quit and get back and clear the search value.
    It does not occurred if I don't quit the page.

    The only solution I have for now is to reload the page on clear search
    but I'm wondering if someone have encounter this and have a solution for this.


    0 0

    I need to show in footer the sum of the column.
    But I need the sum of all records (serverside sum).
    My backend is EDITOR class.


    0 0

    Hi all together,

    I combined the custom rendering and the Data source change event examples from this page: https://datatables.net/extensions/rowgroup/examples/

    Instead of average salary in the custom rendering example, I used the sum() function to have the sum of salary for each city.

    I now need to have a sort option which will sort the groups using the summed up value. When I now click on the last column the single elements in each city will be ordered, but I need the whole groups ordered using the summed up values.

    So, e.g. London is the city with the highest over all salaries, the "London group" should be up, next the second highest salary group and so on.

    This is my current script: https://pastebin.com/KkwYcmNG

    Hope you can help me out here! I tried to built an example in jsfiddle, but I wasn't able to get the custom rendering example running on jsfiddle. If you have a jsfiddle link with this example running I am happy to add all further details of my code.

    Thank you so much!


older | 1 | .... | 2262 | 2263 | (Page 2264) | 2265 | 2266 | .... | 2326 | newer