José F. Romaniello

Las aventuras y desventuras de un codificador.

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.

| More

12 comentarios:

Hi..very interessting project.I will take a look at the source and see if I can help.

Este comentario ha sido eliminado por el autor.

Hi, thank you for your comment. The source code is very outdate. I have requested an autorization for the extjs team to publish at google code. I will upload there the new version soon.

Hi, do you know when you will be uploading the new version? Thanks

@David I will be uploading to google code about next week. I've been talking with the ExtJs team and the project with be licenced under LGPL. So, stay in sync with my blog, I will post about the project news soon.

Hi Jose, great stuff! Did you ever upload this to google code?

No, never. The thing is that you could never use this for a real application only for examples. ExtJs is open source but not "so" open. They have a special agreement with coolite.

Yes I see... You said you had a much more recent version though? Do you think you could post it here so we can see what other types of things you have done?

I can give you the last code, but I want to ask you a favor. Would you be interested to host a new project on google code with the source?
I have approval to do from extjs but never had time.

Hey i just implemented your project for a site i'm working on, one question, i seem to be at a loss as far as implementing Renderers. Any more insight you can give as to how to do a date renderer? When i stick a DateTime into the grid it shows as /Date(12134543433)/

José F. Romaniello dijo...

Yes it is hard, because the way Ms do JSON for datetime is different to the
way that Ext-JS like. But I think there might be a workaround.
On the other hand, remember that you CAN'T USE my project other than for
simple experimentation. Ext-JS has an special agreement with Coolite, and
you can't use even if you are buildn open source software.
And this is why I didn't setup this project on google code or elsewhere.

how to create master detail grid with it.


Publicar un comentario en la entrada