--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/-TIYs_vfs74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Tom,
Yes I do know a particular sample you might find interesting:
app.filter('startFrom', [function() {
return function(input, start) {
start = +start; //parse to int
return input.slice(start);
};
}]);
Perhaps it looks familiar to you ;)
Regards
Sander
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/-TIYs_vfs74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
So you suggest that one .filter can control all the different groups of checkboxes? Each checkbox group needs to pass a different value (sometimes it's a text match, sometimes a boolean)
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/-TIYs_vfs74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Allmost!
small mistake:
function(results, checkboxData){
console.log(checkboxData);
var result = [];
return result;
}
should be:
function(input, checkboxData){
console.log(checkboxData);
var result = [];
input.forEach(function (item) {
if (item does pass) {
result.push(item)
}
})
return result;
}
Regards
Sander
Tom,I updated the plunk a bit: http://plnkr.co/edit/boVzYDP8bX5NG1aDNpTV?p=preview
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/-TIYs_vfs74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
wow thank you. I'll dive in to this later. Though two concerns:
1) is getOwnPropertyNames supported by IE8?
2) there does seem a delay between checking a checkbox and the results being updated.
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/-TIYs_vfs74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/-TIYs_vfs74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Tom,
Well, you may be as cheeky as you want :-P.
Oh, btw, I did some additional work on another version of the plunk, I think you will like that even better ;) this is a part off the html:
<div class="colleft">
<ul class="list-unstyled">
<li ng-repeat='category in checkboxData' ng-init='showAll=false;catCount=category.data.length'>
<h2 ng-click='showAll=!showAll' class='pointer'>{{category.title}}
<small ng-hide="showAll || catCount<=10"> top 10</small>
<small ng-show="showAll"> All {{catCount}}</small>
</h2>
<ul class="list-unstyled">
<li ng-repeat='data in category.data| orderBy:"count":true | limitTo:(showAll ? catCount : 10)'>
<label for='label{{data.name}}'>
<input type="checkbox" data-ng-model="data.filterUpon" id='label{{data.name}}'>
{{data.prefix}}{{data.name}} ({{data.count}}x)</label>
</input>
</li>
</ul>
</li>
</ul>
</div>
Resulting screen:
How is that as a teaser? ;)
Regards
Sander
Hi allWe have a large data set, potentially several thousand results, though just currently a maximum of about 500. We have paging, ordering and filtering (powered by checkboxes). We have noticed that there is an ever so slight delay between selecting the checkbox and/or checkbox label and the dataset being updated. It is a minor delay, very minor and noticed it after looking at some large sites that use clientside filtering, such as SkyScanner:Their checkboxes are rapid. Ours have no more than a second delay.Unfortunately I can't share our site (though anyone wishing to take a closer look, please get in touch) but I have mocked up a demoTypically this works very quickly (even locally with 2000 results) so it has me thinking that other JS in our app is causing the slow down. So that's something to look at.However the main reason I come here is to get a sanity check on our filtering approach. Is it correct? Is it scalable? Any issues you see? In the plunker demo, in script.js, there is a commented-out console.log on line 33. If you enable that it will run the console 600 times, exactly three times the amount of results in the dataset.SkyScanner uses Backbone and therefore I wonder whether it then uses Underscore. Is Underscore going to be a benefit to our project?Generally, any thoughts, tips, solutions you have, please say :)CheersTom
Hi Tim.
The problem is in the lay-out of your data. This is from your data.
"Products_Categories": [
{
"$id": "2",
...
}
},
{
"$id": "3",
...
},
{
"$id": "4",
...
}
}
]
},
Do you don’t have
Products_Categories.CategoryID
but
Products_Categories.[{CategoryID1...},{CategoryID2..}...]
That is more complex as the filter currently allows. Also, this is way more complex then a data structure should be. If you want I can make it to work, but this is not something I will do in my spare time!
Do you have somebody in your surroundings with knowledge on database design? If so, let him fix your database before going further with this.
Regards
Sander
<div ng-repeat="catID in product.Products_Categories">
<div>Cat ID: {{catID.CategoryID}}</div>
</div>
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.