Monday, February 9, 2009

LINQ Plugin for jQuery

Original url: http://plugins.jquery.com/project/jLINQ


If you've used the .NET Framework, chances are you've also used LINQ. The features found in LINQ allow you to work with collections in-memory to query, sort and manage data, much like you would with a SQL command. LINQ also allows you to connect directly to a database to manage records all within your IDE.

jLINQ works like .NET LINQ and lets you use commands to query collections that are in memory. jLINQ copies many of the same commands you find in LINQ like skip or take along with certain aggregate functions like sum.

So how does it work? Check out some of the code below.


var results = $.from(data)
.ignoreCase()
.startsWith("firstName","m")
.or("n")
.isNot("administrator")
.orderBy("lastName")
.select();


And that's it! You are returned a nice neat list of values matching what you entered. View the sample for more about the methods and commands!



No comments:

Post a Comment