DEV Community

Discussion on: What was your win this week?

Collapse
 
dotnetcoreblog profile image
Jamie

This week, I built a paging control for the project I'm working on. That in itself doesn't sound too impressive, but it's as close to vanilla code as possible. It's also abstract enough that I can be added to any page in the app and it'll just work.

The front end uses raw HTML, CSS (I didn't use a UI framework, but did use Flex) and vanilla JavaScript. I've wrapped called to XHR GET methods, such that you simply pass in a url, query string data, and callbacks for success, failure, and always.

The back end uses C# and low level ADO NET calls (no Entity Framework here) to call a hand written stored procedure which takes in the table name, columns to return and filter on, page number, page size, and a search string.

It needs a little more refactoring to get it just right. But it runs so fast (in dev, using a remote database instance) that the loading spinner I added doesn't even have time to display correctly.

If folks are looking to upgrade their we dev knowledge, I'd highly recommend doing something similar. Although, you don't have to eschew frameworks in order to get started - I did, but that's only because I wanted to learn everything involved with writing paging stuff.

It's closed source project, so I can't share the code. But I might re-implement it as an open source lump, and write about how I went about it.