KeyTable with sAjaxSource

KeyTable with sAjaxSource

rameez89rameez89 Posts: 7Questions: 0Answers: 0
edited March 2014 in KeyTable
Allan, I want to use KeyTable navigation with server-side AjaxSource data. I am unable to do it, checked the forum but nothing found interesting. Please help/guide.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    I'd suggest you initialise KeyTable in fnInitComplete . If that doesn't help, please link to a test page showing the issue so I can debug it.

    Allan
  • rameez89rameez89 Posts: 7Questions: 0Answers: 0
    edited March 2014
    Dear Allan,

    I am already using this function and initializing keyTable in fnInitComplete. It focuses on the line but when I press any key it just lost focus.

    I am writing this code:
    [code]
    var myTable = $('#example').dataTable({
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "myPage.php",
    "fnInitComplete": function(oSettings, json) {
    var keys = new KeyTable({
    "table": document.getElementById("example"),
    "datatable": myTable
    });
    keys.event.action(null, null, function (e) { $(e).closest('tr').trigger('click'); keys.block = true; });
    }
    });
    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    It might be because you are using server-side processing, but I'm not sure. If you could give us a link to the page I might be able to debug it.

    Allan
  • rameez89rameez89 Posts: 7Questions: 0Answers: 0
    http://emispk.com/emis/index.htm
  • rameez89rameez89 Posts: 7Questions: 0Answers: 0
    Dear Allan,

    please look into it and reply ASAP.

    Thanks in advance.
  • rameez89rameez89 Posts: 7Questions: 0Answers: 0
    Dear Allan,

    I've noticed a thing, clicking on any row reset the table and goto page 1.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Bit odd that - not sure why it isn't working initially. The fact that it is doing a redraw on every click is very odd!

    Thanks for the test case though. I will take a deeper look as soon as I can - probably sometime next week, as I've already fully booked this week.

    Allan
  • rameez89rameez89 Posts: 7Questions: 0Answers: 0
    Dear Allan,

    Its more than 15 days. You need to sort this out please.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    I will look into as soon as I can. Paid priority support and other tasks have taken priority. If you would like to continue a patch it fix the issue, that would be very welcome, or pick up priority support so I can prioritise it over other work: http://datatables.net/support . Otherwise, I will try to fix it as soon as I can, other work permitting.

    Allan
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Looked into it a bit this morning and the problem is this line in KeyTable:

    [code]
    _oDatatable.oApi._fnDraw( oSettings );
    [/code]

    it is causing the table to redraw on each focus, and since you are using server-side processing that means an Ajax request.

    I'm planning to rewrite KeyTable in a few weeks time, so I will look at solving this at that point.

    Allan
This discussion has been closed.