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

forgot to define html5_data attribute column x error #149

Closed
Organizer opened this issue Jan 19, 2015 · 5 comments
Closed

forgot to define html5_data attribute column x error #149

Organizer opened this issue Jan 19, 2015 · 5 comments

Comments

@Organizer
Copy link

I currently get a "It seems you have forgot to define html5_data attribute for column x" error message when any field/row in my serverside ajax/JSON returns null" as value. Any logic or suggestion to this, tested 0.8.6 and latest beta + latest datatables version.

Some related columns simply defined by -> "data": "6", "visible": false, "searchable": false and yadcf { column_number: 6, filter_type: "autocomplete" }

@vedmack
Copy link
Owner

vedmack commented Jan 20, 2015

Hi,
You can't filter a column that is set to "searchable": false (not with yadcf and not with datatbles)

If you'll have any similar issues with a column that is not set to "searchable": false feel free to reopen this issue and provide additional information

@charliechihuahua
Copy link

Hi,
I get the same error. It occurs when a field in the Json Data array is null and the Data Array is no associative array. Tested in beta 0.8.7

I think the problem is in the function parseTableColumn line number 1487.

if (typeof col_inner_data === 'object') {
    if (columnObj.html5_data !== undefined) {
        col_inner_data = col_inner_data['@' + columnObj.html5_data];
    } else {
        alert('Looks like you have forgot to define the html5_data attribute for the ' + columnObj.column_number + ' column');
        return;
    }
}

if the Field Value data[j]._aData[columnObj.column_number] is null it is an object.
if (col_inner_data !== null && typeof col_inner_data === 'object') solved the problem.

@SoerenWeber
Copy link

I just experienced the same behavior @charliechihuahua observed and was able to solve it by using their solution with version 0.9.4.beta.35.

Do you see a reason a drawback in this solution, @vedmack ? I could open a PR if you like. :)

@vedmack
Copy link
Owner

vedmack commented Dec 20, 2019

@SoerenWeber , yes that would be great, make sure to apply the pr to the src version

@vedmack vedmack reopened this Dec 20, 2019
@vedmack
Copy link
Owner

vedmack commented Dec 29, 2019

committed the fix in 0.9.4.beta.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants