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

If html5 data- attributes set (data-filter etc) on td's, yadcf returns 'undefined' #106

Closed
FriendlyWP opened this issue Nov 13, 2014 · 7 comments

Comments

@FriendlyWP
Copy link

If I set data-filter or data-sort attributes in order to control sorting per this article, YADCF stops working and returns 'undefined' when using 'select' dropdowns: http://www.datatables.net/examples/advanced_init/html5-data-attributes.html

I'm trying to sort a firstname-lastname column by last name, by inserting data-filter in the 's. I tried all four (data-filter, data-search, data-order, data-sort) and they all give the same result.

Any way yacdf could support these? Thanks so much!

@vedmack
Copy link
Owner

vedmack commented Nov 14, 2014

Sorting issues again ? :) haven't tried those, will see whats wrong.

@vedmack
Copy link
Owner

vedmack commented Nov 15, 2014

Please use this jsbin http://jsbin.com/bigigo/2/ to demonstrate your issue (it uses latest daatatbles and yadcf versions)

@FriendlyWP
Copy link
Author

Here you go - see column 0 html / output:
http://jsbin.com/lanaboguha/1/edit?html,css,output

I get the same results with data-search, data-order, and data-sort in the
td's.

Thanks for investigating!!

Michelle

On Sat, Nov 15, 2014 at 8:51 AM, Daniel notifications@github.com wrote:

Please use this jsbin http://jsbin.com/bigigo/2/ to demonstrate your
issue (it uses latest daatatbles and yadcf versions)


Reply to this email directly or view it on GitHub
#106 (comment).

@vedmack
Copy link
Owner

vedmack commented Nov 15, 2014

What would you expect to populate the select box, the value located in data-filter attribute or the content of the td itself (the visible string) ? eventually I guess I'll make it configurable, just pondering what I should set as a default behavior?

@FriendlyWP
Copy link
Author

I think the data-filter attribute would populate the select...? I'm
thinking of a first name - last name type situation, where the list itself
displays first-last, but the select dropdown shows last, first (or just
last). Or in the case of dates, the columns might show full date info, and
the data-filter & select dropdown just the year.

But that's just me. I'm open to whichever you choose to implement! :)

On Sat, Nov 15, 2014 at 3:31 PM, Daniel notifications@github.com wrote:

What would you expect to populate the select box, the value located in
data-filter attribute or the content of the td itself (the visible string)
? eventually I guess I'll make it configurable, just pondering what I
should set as a default behavior?


Reply to this email directly or view it on GitHub
#106 (comment).

Michelle McGinnis
Friendly Web Consulting
http://friendlywebconsulting.com
512.650.8144

vedmack added a commit that referenced this issue Nov 18, 2014
New filter type: "multi_select_custom_func" / New attribute, html5_data / More goodies

#106
#105
@vedmack
Copy link
Owner

vedmack commented Nov 18, 2014

Added in 0.8.6
From docs:

* html5_data
                Required:           false
                Type:               String
                Default value:      undefined
                Possible values:    data-filter / data-search / anything that is supported by datatables
                Description:        Allows to filter based on data-filter / data-search attributes of the <td> element, read more: http://www.datatables.net/examples/advanced_init/html5-data-attributes.html

b.t.w the moment you use the data-filter / data-search , datatables relies only on them to do the filteting so displayed values cannot be used for the filtering

@vedmack vedmack closed this as completed Nov 18, 2014
@Organizer
Copy link

Not sure it's related yet but 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 setup and ajax/JSON contains "null" as value. I guess this update was the one adding that error message to the system, apologies if wrong as I'm pretty new to all of this.

related: #149

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

3 participants