Tuesday, September 14, 2010

Catch Phrase Turn Off Sound

[GWT] [GXT] The grids

In GXT, we often need to format the data. I needed to do, when I went to the showcase of Sencha, I saw the exapander plugin for grid . A beautiful record which displays supplements information for a list of items given. It will
this:



We share our model to move towards the view.

Here our model: Student =

It declares three attributes to a single manufacturer and receive our 3 attributes.
It then creates an interface that inherits from BeanModelMarker

Do not forget the @ BEAN ({} package.} {Class. Class), it is very important in the link between the Student class and this interface. Now we move

side view

where we want our grid view, we created a list of Student, called Students:

We then created a store for each Student Students from our list, it generates the BeanModel partner. Thus, we have a store containing BeanModel:
It then creates a XTemplate (kesako? Is what will be displayed when you click on the little extra in our grid, we can not do if you want just a standard grid):
Now, create the columns. It where it created a list of Magique.On ColumnConfig, we add our plugin expander that allows us to post additional information as the previous XTemplate then created as many new ColumnConfig you want column.

two very important methods above,

colum.setHeader ("Name");
colum.setId ("firstName");

The magic method is that last. What he goes => firstName is, you may have already noticed, the name of an attribute of my Student object. We must return to our Student model to generate all the getters that we need. here firstName and LastName Student.class.php


Now it's almost finished, create the famous Grid passing it to our list (Student) and our BeanModel ColumnModel cm.


Well, it's over and normally, I just test it, it works niquel!
Enjoy;)

0 comments:

Post a Comment