This post (http://fabrikar.com/forums/index.php?threads/using-a-mysql-view-as-data-source-for-a-list.41371/) managed to create a list from a view in an external database by directly editing the fabrik_lists table (db_primary_key) to enter the PK - the Fabrik form throws an error and the key selection is not saved. Also in order to set up a pre-filter you need to edit the table - this time the params field. This works very well.
I'm trying the same technique to set up the Order by data for the list as this is not possible via the Fabrik forms. I've found the two fields that look like the right ones - order_by and order_dir . By inspecting the values in these fields for lists based on tables, it looks as though the value for order_by is a string containing the element id e.g "74". order_dir seems straightforward - either "ASC" or "DESC".
I tried the element id route but this gave an error - the SQL included the literal value. However if I insert the fully qualified field name e.g. ["vWItemsForColl2___ColDate"] it 'seems' to work. The only problem is that the ordering is erratic - so in fact it may not be working at all - simply just not giving an error. The other approach I tried was changing the MySQL view to include an ORDER BY clause - but this seems to have had no effect.
What values should I insert in the fabrik_lists table to get a list to display consistently in the correct sequence ? Thanks.
PS. Using the item id failed because I picked the wrong one ! Using the right one not only doesn't cause an error but the order details are now viewable in the Fabrik form. But the order of the list still isn't right. Any suggestions on what else I might have got wrong ?
I'm trying the same technique to set up the Order by data for the list as this is not possible via the Fabrik forms. I've found the two fields that look like the right ones - order_by and order_dir . By inspecting the values in these fields for lists based on tables, it looks as though the value for order_by is a string containing the element id e.g "74". order_dir seems straightforward - either "ASC" or "DESC".
I tried the element id route but this gave an error - the SQL included the literal value. However if I insert the fully qualified field name e.g. ["vWItemsForColl2___ColDate"] it 'seems' to work. The only problem is that the ordering is erratic - so in fact it may not be working at all - simply just not giving an error. The other approach I tried was changing the MySQL view to include an ORDER BY clause - but this seems to have had no effect.
What values should I insert in the fabrik_lists table to get a list to display consistently in the correct sequence ? Thanks.
PS. Using the item id failed because I picked the wrong one ! Using the right one not only doesn't cause an error but the order details are now viewable in the Fabrik form. But the order of the list still isn't right. Any suggestions on what else I might have got wrong ?