-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom item ordering and categorizing for the widget #167
Conversation
Wouldn't it better to do the filtering of items on the server side. |
Here customising category on the client side involves overriding the existing categories and also classification of items. Wouldn't this lead to confusion. |
boxoffice/templates/boxoffice.js
Outdated
@@ -165,10 +166,22 @@ $(function() { | |||
}).done(function(data) { | |||
var lineItems = []; | |||
|
|||
// Flag: If items have been explicitly specified in the config | |||
var should_filter_items = (widgetConfig.categories && widgetConfig.categories.length > 0 ? true : false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can just be widgetConfig.categories.length > 0
.
@shreyas-satish Works with ids instead of names - I've updated the example here to reflect that. Good to merge? |
Implements #166.
Available via a new config
categories
An Item's
name
is unique in an item collection, and is human readable so I chose that overid
Examples
With categories
With duplicates and ordering
Without any value, defaults to server defined categories