andrewmcgivery / ionic-ion-autolistdivider Goto Github PK
View Code? Open in Web Editor NEWGives a set of directives for automatically adding in list dividers for an ng-repeat. (Works for Alphabetical or by Categories)
Gives a set of directives for automatically adding in list dividers for an ng-repeat. (Works for Alphabetical or by Categories)
Hello, @andrewmcgivery your ionic-ion-autoListDivider helped me a lot, thank you.
But I faced a problem. I want combine all non letter symbols and digits under one divider.
For example I have list
a,2,c,(9),+P,s,/ff...
and I wonder to know how can I unite 2,(9),+P under one divider?
Hi,
Great work. It would be fantastic to see some performance benchmarks for this list. With that, it would be fantastic if sticky headers was added as a potential option:
Here is a demo of what I mean:
http://codepen.io/anon/pen/EawXRO
And here is the forum thread and trello board vote:
http://forum.ionicframework.com/t/sticky-list-headers/689/33
https://trello.com/c/kGTvppdl/57-ion-list-sticky-items
It'd be interesting to see if the intent of the ionic team is to pull this kind of functionality into ionic core or if they'd prefer to keep it out as plugins. There are probably pretty good arguments for both.
I think it would be a good addition if it worked with a collection-repeat instead of ng-repeat.
Pulled this directive in, and when doing a pull to refresh on this directive with a list, it seems to duplicate the item-dividers that were initially inserted as dupes at the bottom of the list.
Hi I send you a msg on IonicForum
http://forum.ionicframework.com/t/dividing-a-list-automatically-in-ionic-framework/17120
It would be very relevant to have the possibility to make a proper search in this list.
Regards,
What about adding a vertical line on the right with A-B-C etc so if user clicks on the letter it jumps to that section? This would be very useful if you have a ton of items in the list. Apple uses it for their Contacts app.
How do I bind ng-click events to the newly inserted dividers?
I add:
ng-click='clicked()' to:
var contentTr = angular.element("<div ng-click='clicked()' class='item item-divider'>"+divideKey+"</div>");
yet it doesn't fire in the directives scope:
scope.clicked = function() {
alert('clicked');
}
I tried adding a footer for each but it doesn't work. It doesn't work because it doesn't show up on the iOS Simulator (haven't tried on Android). If I do ionic serve
(Firefox is my default browser), Firefox just freezes and I can see Firebug is counting the number of errors. I tried to debug after clicking (Debug Script from a popup) but unlike normal scenarios, it doesn't highlight exactly where the problem is.
Inside your directive, you have this if-statement:
if(divideKey != lastDivideKey) {
var contentTr = angular.element("<div class='item item-divider'>"+divideKey+"</div>");
element[0].parentNode.insertBefore(contentTr[0], element[0]);
// adding a div using jQlite .after()
element[0].after('<div></div>');
}
In your CodePen http://codepen.io/andrewmcgivery/pen/XJeQyW?editors=101 I added the same line of code (element[0].after('<div></div>');
) and it appears with no problem except that it's just not the look that I want and that it only attaches on the first first item of the new divided section. But when I did the same thing and run it on the browser via ionic serve
or running from Xcode to an iOS9 Simulator, the browser or nothing appears at all, respectively.
The README refers to auto-divider-function
in two places. The code is expecting auto-list-divider-function
(line #15).
(I tried to fix this with a pull request, but I was getting errors--sorry!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.