ExtJs Grid Helper - some samples
In my previous post I've talked about my ExtJs Grid helper. I want to show you in this post some samples. Lets start with the basic configuration. This is all you need to get an ExtJs Grid running. The first parameter of the SetDataStore method is the controller/action that returns the JSon data, the second parameter is the PK field. The WithAutoColumnModel method specifies that the grid must show a column for each property on the Person class. Let me add some custom columns: and this is what will be generated: So far so good, lets talk now about server-side paging. If you want paging support you have to add some parameters to the controller action (start and limit ) and return sliced data. You could take advantage of linq but I dont want to talk about that. Also, you need to make several changes to the view. It's a joke, just add WithPaging(pageSize) or just WithPaging() (whose default is 15) : ExtJs grid has support for custom column renderers. I wouldn't resolve this on the client-side, however: You could use this to create a custom cell format for a given value. There other options that I will skip: .WithLoadMask() .WithSizeOf(0, 300) .WithSelectionMode(SelectionMode.SingleSelect) Sorting is not yet supported. I hope you like this post and please drop me a mail if you are interested in this project.