Giter Club home page Giter Club logo

datatables-live-ajax's People

Contributors

jhyland87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datatables-live-ajax's Issues

Disable Error Alert

First off โ€“ awesome Javascript plugin; not sure why this hasn't gained more traction back in the days. Probably because less people use DataTables with Editor.

Anyways, is there a method to prevent the alert window from appearing when an error occurs and overwrite the functionality? I tried using the xhrErr.liveAjax, but couldn't manage to disable the default behavior.

Failing to poll: uncaught typeError

Hi there!

I'm implementing a polling mechanism for my DataTables-based application and rather than writing everything from scratch, I stumbled across your plugin. I don't need the "selective updating" which is at the core of what you've done, but it's still low-hanging fruit to use DataTables LiveAjax for interval, pause, and cancel methods.

However, when I try to fire up liveAjax in a table, I encounter the following error:

Uncaught TypeError: Cannot read property '0' of undefined

Which is found on this line:

                if ( json[ dtSettings.liveAjax.dataSrc ][0][ dtSettings.liveAjax.rowId ] === undefined ){

I call my DT in a slightly unconventional way, but I'm not sure why it is failing:

fcapp.storedTables.sessionTable = $('#sessiontable').on('error.dt', fcapp.tables.dtErrorHandler).DataTable({
      "ajax": {
        "url": "/rs/sessions",
        "dataSrc": function (json) {
          return fcr.utils.ensureArray(json.session);
        },
        "headers": {
          "RESTSessionSecret": sessionStorage.getItem("currentSession")
        }
      },
      liveAjax: true,
      "columns": [
        {"data": "userName",
          "title": "user name"
        },
        {"data": "remoteIP",
          "title": "IP"},
        {
          "data": "fileName",
          "title": "file"
        },
        {
          "data": "status",
          "title": "status"
        },
        {"data": null,
          "sortable": false,
          "defaultContent": fcapp.render.tools('group'),
          "createdCell": function (td, cellData, rowData, row, col) {
            $(td).addClass('toolcell');
          }
        }
      ],
      "rowCallback": function (row, data, index) {
        fcapp.render.row(row, data, index);
      }
    });

DataTables is 1.10.8, and it is using dataTables.bootstrap.js as well.

Any insight? What are the usual causes of such an undefined?

Feature: update changes from a table diff

For another purpose, I just implemented a server-side mechanism to return a list of changes that have been made to a (table-like) data source since last request. It's fairly simple, one just has to keep a timestamp on server side to identify subsequent requests (keyed by for example custom HTTP request header, GET/POST parameter, or URL path segment).

It's easy to see that for large tables, it can be very effective to be able to parse and update the datatable from this 'diff' (instead of reloading the full data each time). Especially in a scenario when data is read often but updated realtively rarely, and one can keep a change journal on server side that's modified whenever data is changed (rather than a diff being computed for each request).

A table diff could be as simple as a JSON array containing records comprised of just a operation indicator and (added/deleted/changed) row contents. Operation indicators could be numbers, such as -1 for deletion, 0 for change and 1 for addition. Or symbols such as '+', '-' and '~' . I would not recommend using full verbs such as "add", "delete" & "change", although it does not of course matter that much if the set of changes is always fairly small between requests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.