⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

set_relation_n_n and flexigrid sorting



johnvanham
  • profile picture
  • Member

Posted 14 May 2012 - 12:48 PM

Hi there and can I first say what an awesome library!

A quick query - sorry if it's been asked already but I couldn't find if it had by searching the forum..

With fields which have a many to many relationship, when displayed using the flexigrid is it possible to get these to be sortable?

Many thanks,

John

johnvanham
  • profile picture
  • Member

Posted 14 May 2012 - 13:55 PM

Actually I think I've just found a bug with flexigrid and set_relation_n_n...

If you click a column in the flexigrid to order it by that column which is using set_relation_n_n, the POST request ajax_list includes order_by and then that column name.

However as that column isn't one which exists in the table as the data is coming from the linking table and the linked table and as a result a 500 error is returned with an error from MySQL saying that column doesn't exist.

Unfortunately this then breaks the flexigrid even if you refresh the page because it continues to try and order by that column - so if you try and perform a search, or pick a different number of records to view etc. you continue to get a 500 error for each ajax request. To the end user it just looks like none of the filtering works at this point.

johnvanham
  • profile picture
  • Member

Posted 14 May 2012 - 14:07 PM

Doh, I see you have fixed sorting in 1.2.2! I'm too slow.

However I am seeing a new bug in this version. Searching is not working because I get a 500 error from ajax_list_info as it is trying to do a where search on the column name used for the set_relation_n_n

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 15 May 2012 - 07:15 AM

Searching is not working only for all (damn!!!). If you try search by column it will work fine.

johnvanham
  • profile picture
  • Member

Posted 15 May 2012 - 13:40 PM

Right so not something I have done wrong then - good! :-)

I'll watch github to see when you fix that.