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

Error when using orthogonal data and text_data_delimiter (support columns.data.filter) #552

Closed
tanyona opened this issue Feb 26, 2019 · 7 comments

Comments

@tanyona
Copy link

tanyona commented Feb 26, 2019

There's an error if you use an ajax source and specify an object for the data attribute as per the datatables orthogonal data documentation and use the text_data_delimiter delimiter as well. I believe the error in the console is TypeError: data[j]._aData[column_number_filter] is undefined.

Here's a jsfiddle with an indication of the problem. https://jsfiddle.net/y2ghwpbs/1/

@vedmack
Copy link
Owner

vedmack commented Mar 4, 2019

Hi

You can init the columns like that: var columns = [{"data": "name"}]; and it will work with yadcf

see it working

@tanyona
Copy link
Author

tanyona commented Mar 4, 2019

True. But I would like to have a different property to be used for the display value and a different property for the filter value. This syntax is supported by datatables, but errors with yadcf, e.g.

var columns = [
	{ data: {
		_: "name",
		filter: "nameFilter"
		}
	}
]

@vedmack
Copy link
Owner

vedmack commented Mar 4, 2019

@tanyona It doesn't work like this (tested in you example page without yadcf)
please provide a working example in the desired format e.g _: "name", filter: "nameFilter"

@tanyona
Copy link
Author

tanyona commented Mar 4, 2019

Here's an example - https://jsfiddle.net/7k9zmsLo/

It doesn't use the yadcf filter. The datatables search filters according to the "nameFilter" property of the data.

@vedmack
Copy link
Owner

vedmack commented Mar 4, 2019

@tanyona please post the relevant docs of this feature from datatables

@tanyona
Copy link
Author

tanyona commented Mar 4, 2019

https://datatables.net/reference/option/columns.data. The object type/section.

@vedmack vedmack changed the title Error when using orthogonal data and text_data_delimiter Error when using orthogonal data and text_data_delimiter (support columns.data.filter) Mar 5, 2019
vedmack added a commit that referenced this issue Mar 5, 2019
fix for #552 - added support for support columns.data.filter, see https://datatables.net/reference/option/columns.data
@vedmack
Copy link
Owner

vedmack commented Mar 5, 2019

fixed in 0.9.4.beta.18 (located in src folder)

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

No branches or pull requests

2 participants