Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullpointer Exception table with filter and no data #30

Open
mambarek opened this issue Apr 23, 2018 · 0 comments
Open

Nullpointer Exception table with filter and no data #30

mambarek opened this issue Apr 23, 2018 · 0 comments
Labels

Comments

@mambarek
Copy link

mambarek commented Apr 23, 2018

user the plugin for

  • an empty HTML-Table (no rows)
  • the options data attribute is not defined
  • define filters for some cols

this throws a Nulllpointer exception in line 899 initializing filter.
to fix this I add a acondition in the line 165 as follow

if(this.data)
this.filter();

Backround: my table is a table to manage employees. So at first time i don't have any employee. click a button to create an employee, after saving i become data.

so more tests for an empty table throws more exception because the filter and sort are too data based. so to avoid this i put all this in the same condition

if (this.data) {

    /* Add sorting class to all th and add callback. */
    this.createSort();

    /* Add filter where it's needed. */
    this.createFilter();

    this.triggerSort();

    this.filter();
} 
@Holt59 Holt59 added the bug label Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants