Datatables width and sort

07 Mar '17, 04:44 PM
3,119 Views
No Forum Badges

Hi, I'm using datatables for a simple "shop" style web app, I have Product, Price and 2 flow links for each row. I have a couple doubts:

1) Is there a way to make those last 2 flow columns adaptive to the content? If one link is longer than a certain amount it goes on two rows while there's a lot of free space in the other columns.

2) Is there a way to sort float columns? Right now the sort method looks like it sorts alphabetically and not by value, so for example if I have 9.0-65.0-87.0 the descending sort is 9-87-65 instead of 87.0-65.0-9.0. Integer sort works perfectly instead.

I hope I was clear enough.

 
x 0
Follow
Answer Answer at this question and get points!
Forum Hero - Level 9

Hi Simone,

here the answers:

1) to solve it you can refer to the css properties. For example you can apply "white-space: nowrap;" on the <a> element related to your link.

2) to sort a column you have to define it in the "Sort Attributes" Property available in the Properties View of the Simple List. Moreover the Attribute should be defined as float or decimal in the Domain Model. Anyway check if you are using the last version of the template available on the Add-ons store.

 
x 0
Answer at this question and get points!