Pages

Monday, February 24, 2014

A Multi-Term jQuery Mobile Listview Filter

If you've done any development with jQuery Mobile you've likely used the Listview Widget. It's a handy little component that makes rendering list data a breeze. Even better, it has a built in search filter that you can enable by simply decorating your list element with data-filter="true"



The default behavior of the Listview Widget's filter is to match on a single term. The moment you add an additional space into your search string, look out! But, if you need multi-term search behavior in your filter, it's easy to add.

Tuesday, February 4, 2014

Quick and Compliant Email Templates using Razor

Even in today's hyper connected world where you can Tweet someone's TV or Instagram your refrigerator, it seems like when it comes to business, Email is still king. If you need a simple, effective, and fast way to create a templated email in code, I suggest using Razor as your templating engine.

If you've done any MVC development since version 3, you've likely used the new Razor View Engine. Its concise and semantic, and it gets out of the way of your html. Best of all, it's not dependent on MVC, so you can re-purpose it in many different ways.

There are already a few existing projects that surround Razor templates. In this example I'm using the following project, but you can use whatever you prefer to get the job done:

https://github.com/volkovku/RazorTemplates

I like the RazorTemplates project because like Razor itself, the syntax in the RazorTemplates project is concise and semantic.