OctoberCms - Model Filter Field Depends On Filter Field
I have a filtered field depending on a filtered field: ...
basket: label: Basket prompt: 'Add Item' span: full type: repeater form: fields: item: label: Item emptyOption: 'Select Product' showSearch: true span: auto type: dropdown totalprice: label: 'Total Price' span: right readOnly: 1 dependsOn: - item type: number subtotal: label: 'Sub Total' span: auto default: '' readOnly: 1 dependsOn: - basket type: number
The idea is that when an item within the basket is updated, the total price for that item updates which causes the basket to update. this then makes the subtotal for the basket update.
The total price for each item updates fine no issues at all. However, the subtotal seems to always be one update behind. I believe this is because the fields are only actually updates at the end of the filterfields function?
Is there anyway to allow filterfields dependant on filtered fields?
To my experience repeater are a quick, but not the ideal solution for tasks as you are describing. A related 'basketitem' table with a belongsTo (baskitem belongsTo bask, bask hasMany baskitems) could solve your problem. And by the way there is a tutorial to use as a pattern at https://octobercms.com/support/article/ob-21
- → Create plugin that makes objects from model in back-end
- → OctoberCMS Fileupload completely destroys my backend
- → Laravel - keeping a running tally of a column through a transformer
- → angular ng-repeat and images in a row
- → Eloquent ORM laravel 5 Get Array of ids
- → Chaining "Count of Columns" of a Method to Single Query Builder
- → Render array of inputs in react
- → Remove an ObjectId from an array of objectId
- → Laravel Default Where caluse
- → Creating indexes for Elasticquent in Laravel
- → Trying to style output from my view file in Codeigniter with AJAX and
- → Insert data into 2 different tables from a single form using OctoberCMS Builder Plugin