Natural Sort in Views of Webforms

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
figtree_development's picture

I have created a simple internal auction system. I have a content type, a webform, and some views. I know I could have used drupal commerce and an auction module but honestly i didn't need all that extra overhead.

Content is created. Then assigned it to a particular auction(taxonomy term). I have a view for each auction. I created a webform. NID of the item is passed to the webform for ref.
The view displays a table of webform results (webform mysql module) that are assoc to the NID of the item. Therefore, only displaying the bids for that item.

BID is an interger. Works great except for the sort feature. I am attempting to sort by BID amount DESC. Its not working.

If I had the following results for example:
12,13,14,15,16,17,20,150

the view would display in this order:
12,13,14,15,150,16,17,20

the result wanted is this:
150,20,17,16,15,14,13,12

I am using views relationships to assoc bids to nodes, user data to bids (bidder's full name), webform submission ( to order bids).

any thoughts would be welcomed.
Thanks!

Comments

No luck

figtree_development's picture

No luck finding a views solution. So my solution in a pinch:
Create a custom block with php code. accessing mysql view table for data.

Then converting bid from varchar to int in mysql statement (Drupal webform inputs as int, however mysql view module must convert to varchar).

Then using jtable to display content. not perfect but it works for now until I figure out why I can not sort in views properly.

Florida

Group organizers

Group categories

Florida Topics

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: