bud

00000000000000000000000000000000?d=mm&f=y&s=250

Joined 8/5/2017
# Name
00000000000000000000000000000000?d=mm&f=y&s=64
bud said 18 days ago:

How do you deal with enums in this setup?  Say I have an integer column and I use enums in it - 0 is "no" and 1 is "yes".  How do you filter for the strings rather than the integers within the table?

635114?v=3&s=64
kobaltz said 18 days ago:

Great question. It really depends on the complexity to which you've modified the datatables. If you are using server side data and a full text engine, then I would store the 'yes' and 'no' values as part of the indexed data.

If you're using Rails 5.1.x then you could also use a virtual attribute to search on instead of the integer column.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 18 days ago:

Thanks for the quick reply.  I am indeed using Rails 5.1.x.  Do you have an example in the context of your demo in how I could accomplish this with virtual attributes?  Never heard of these and am reading about them now.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 18 days ago:

Thanks!  Very useful.  I understand the concept, but I'm still not sure what the best approach would be to use virtual attributes against an integer column and somehow extract a string from that.  Would I need to define a virtual attribute for each integer that I have mapped as an enum?  In my case I have up to 10 enums in some columns.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 13 days ago:

Just a fyi - I ended up creating my own custom select boxes that handle filtering for my enum columns.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 18 days ago:

Thanks for the quick reply.  I am indeed using Rails 5.1.x.  Do you have an example in the context of your demo in how I could accomplish this with virtual attributes?  Never heard of these and am reading about them now.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 18 days ago:

Thanks!  Very useful.  I understand the concept, but I'm still not sure what the best approach would be to use virtual attributes against an integer column and somehow extract a string from that.  Would I need to define a virtual attribute for each integer that I have mapped as an enum?  In my case I have up to 10 enums in some columns.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 18 days ago:

Thanks!  Very useful.  I understand the concept, but I'm still not sure what the best approach would be to use virtual attributes against an integer column and somehow extract a string from that.  Would I need to define a virtual attribute for each integer that I have mapped as an enum?  In my case I have up to 10 enums in some columns.

00000000000000000000000000000000?d=mm&f=y&s=64
bud said 13 days ago:

Just a fyi - I ended up creating my own custom select boxes that handle filtering for my enum columns.