table.page.jumpToData error

table.page.jumpToData error

Enzo TrucchiEnzo Trucchi Posts: 6Questions: 2Answers: 0

Hi!
I have a situation here
I trying to use the plugin "JumpToData". The problem is that not work, but i not receive any errors in console. Confusing.

table.page.jumpToData(469, 1);

var table = $('#test').DataTable({ ... }) //client side
469: ID called by ajax
1: Column with ID's values from ajax source.

Strange, because with string values i have the same behavior:

table.page.jumpToData("test", 2);
"test": string called by ajax
2: Column with strings values from ajax source.

pd: v.1.10 and api source

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi Enzo,

    Does this blog post help? If not, can you post your table code please, or create a live example for it.

    Cheers,

    Colin

  • Enzo TrucchiEnzo Trucchi Posts: 6Questions: 2Answers: 0
    edited May 2018
    $(document).ready(function() {
    
    var table = $('#tarifario_venta').DataTable({
        "processing": true,
         "ajax": {
                "url": "getGrillaTxc_cs.php",
            "dataType": "json"
          },
          "sAjaxDataProp": "",
          "columns": [
            {
                    "orderable": false,
                "render": function ( data, type, full, meta ) {
                    if ($('#txc_id').val() == full.txc_id) {
                        return '<input type="radio" checked="checked" name="trayecto_cliente[]">';
                        } else {
                        return '<input type="radio" name="trayecto_cliente[]">';
                        }
                }
                  },
            {"data":"txc_id"},
            {"data":"cli_nombre"},
        ],
        "order": [[ 2, 'desc' ]],
            "pagingType": "full_numbers",
        "dom": "<'row'<'col-lg-12'><'col-lg-12'tr>>"+"<'row'<'col-lg-2'i><'col-lg-10'p>>"+"<'row'<'col-lg-2'l>>",
             "language": {
            "url": "../style/spanish.txt"
           },
          "responsive":true
    })
                
    table.page.jumpToData(469, 1);
    **
    //In this moment i call a function JumpToData. No errors, but no working.. 
    //ID: 496 its a example with a test column, actually that value its a selected with a radio button in first col**
    
    });
    
  • Enzo TrucchiEnzo Trucchi Posts: 6Questions: 2Answers: 0

    Hi Collin, i post the code
    I think that blog post its for server side.
    Any way, thx for the help! :smile:

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi Enzo,

    I think it's because you need to quote the number - see the example here. Could you give that a try please.

    Cheers,

    Colin

This discussion has been closed.