Auto-saving calc field values in db

joomlamate

Member
Hello,

following this old thread (http://fabrikar.com/forums/index.ph...sorting-of-calculated-field.14229/#post-79129),

I am in need to sort list, based on the values of calculation fields.
Calculation fields are getting their values from another component.

Is there any workaround, so calculation fields will save their values in the db (e.g for example when loading the list or sorting the list), or anything similar to come closer to this ?

I haven't had a look at cron plugin.. Is it possible that it would be of any use here?
 
Finally, I took a different approach.

Instead of having calculation fields that will run on the list load and return a result (querying the db for this purpose = resources consuming), I created a simple field that will hold the calculated value - after a php list plugin will run on the selected rows on demand.

I won't have instant updates each time I load the list, but this will be a click away.
So, this way I have calc values stored in the database and I can sort/search on that field.
 
There is a php_events list plugin, which would allow you to run some PHP on the onPreLoadData hook. This is called just before Fabrik loads the row data. So you could potentially update your sort field at that point. I don't know what kind of calculation you are having to perform, but it could probably be done in one or two queries.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top