PDA

View Full Version : Yet another GridPanel



kodomo
26 Sep 2010, 5:41 PM
I made this because I'm gonna need to use it a lot... for the most common scenario for me: display data of a database table, make editable for some, give full access to other.

Now, I want to share it, for the ones that would help it. (I know it would have helped me a lot a couple of months ago).

Code + Example here (http://152.74.40.13/~ifiguero/crudGridPanel/) (the server is a little slow sometimes)

Thanks to Jay Garcia for his great screencast. It helped me A LOT to make "better" code.

If someone would give me a hint of how manage file uploads with a scheme like this, would be great.

Any bug, or insight ( I know it's not the best code, but It's my first coded w/o Ext.getCmp ) would be appreciated.

Cheers,
Israel Figueroa

Animal
28 Sep 2010, 1:46 AM
You need to give your popup window a title of   so the header has a height.

Also, why frame the FormPanel inside the window? It just looks weird. Use border: false

kodomo
28 Sep 2010, 6:24 AM
I modified the frame in the form, but I didn't get the   in the window title. What is that for? I did notice one Window title has an issue overlaping the form with the "title"... but it seems to be ok now.

Thanks for the comment!

I was beginning to think that the code didn't worth a comment! lol

Animal
28 Sep 2010, 7:12 AM
With no title you get this:

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/notitle.jpg

Maybe you should style the FormPanel with some padding to indent things a little. And make its background-color transparent.

kodomo
28 Sep 2010, 9:31 AM
is that a IE bug? i tested it on chrome and FF 3.6 and looks like this (there is a default title as you can see):

http://img201.imageshack.us/img201/6987/clipboard02jpeg.jpg

Sorry about the lazy design, is not my strength.

now it looks like

http://img338.imageshack.us/img338/6987/clipboard02jpeg.jpg

Draykos
30 Sep 2010, 6:51 AM
Good!
It's a pity I just finished a similar kind of work.
Your code seems better then mine.

For my personal needs, it would be better if you can set JsonReader and Writer in constructor or in initialize, without using Ext.Direct.

kodomo
30 Sep 2010, 8:28 AM
Thanks!,

Well the store issue affect me also, I realized that after I finished it. It's kinda Direct-Action-Method dependent so if the methods are different you have to build the stores manually as a common GridPanel.

I wish someone could point out a better solution, but if you think this as a normal GridPanel, the store can be created previously and passed in the store configuration option.