9,8 → 9,7 |
import org.tela_botanica.client.interfaces.ListePaginable; |
import org.tela_botanica.client.interfaces.Rafraichissable; |
import org.tela_botanica.client.interfaces.VueListable; |
|
import com.google.gwt.user.client.Window; |
import com.gwtext.client.core.EventCallback; |
import com.gwtext.client.core.EventObject; |
import com.gwtext.client.core.Ext; |
import com.gwtext.client.core.ExtElement; |
20,13 → 19,16 |
import com.gwtext.client.data.MemoryProxy; |
import com.gwtext.client.data.Record; |
import com.gwtext.client.data.RecordDef; |
import com.gwtext.client.data.SimpleStore; |
import com.gwtext.client.data.Store; |
import com.gwtext.client.data.StringFieldDef; |
import com.gwtext.client.widgets.Button; |
import com.gwtext.client.widgets.Component; |
import com.gwtext.client.widgets.Tool; |
import com.gwtext.client.widgets.event.ContainerListenerAdapter; |
import com.gwtext.client.widgets.form.ComboBox; |
import com.gwtext.client.widgets.Toolbar; |
import com.gwtext.client.widgets.ToolbarButton; |
import com.gwtext.client.widgets.ToolbarTextItem; |
import com.gwtext.client.widgets.event.ButtonListenerAdapter; |
import com.gwtext.client.widgets.event.PanelListenerAdapter; |
import com.gwtext.client.widgets.grid.CellMetadata; |
import com.gwtext.client.widgets.grid.ColumnConfig; |
import com.gwtext.client.widgets.grid.ColumnModel; |
107,7 → 109,6 |
*/ |
private int nbElements = 0 ; |
|
|
private ListeObservation cacheListeObservation = null; |
|
private Tool exporterObservations = null ; |
136,9 → 137,35 |
bt = new BarrePaginationVue(this); |
bt.setLabelElement("Observations"); |
bt.setTaillePageParDefaut(20); |
bt.setIntervallesPages(new String[] {"400","200", "100" , "50" , "20"}) ; |
this.setBottomToolbar(bt) ; |
bt.setIntervallesPages(new String[] {"400","200", "100" , "50" , "20", "10"}) ; |
this.setTopToolbar(bt) ; |
|
Toolbar barreActions = new Toolbar(); |
ToolbarButton transmettre = new ToolbarButton("Transmettre"); |
transmettre.addListener(new ButtonListenerAdapter() { |
public void onClick(Button b, EventObject e) { |
observationMediateur.transmettreObservations(); |
} |
}); |
ToolbarButton supprimer = new ToolbarButton("Supprimer"); |
supprimer.addListener(new ButtonListenerAdapter() { |
public void onClick(Button b, EventObject e) { |
observationMediateur.supprimerObservations(); |
} |
}); |
|
|
ToolbarTextItem exporter = new ToolbarTextItem("<a href=\"#\" id=\"lienExport\"> Exporter </a>"); |
|
barreActions.addButton(transmettre); |
barreActions.addSpacer(); |
barreActions.addButton(supprimer); |
barreActions.addSpacer(); |
barreActions.addItem(exporter); |
|
|
this.setBottomToolbar(barreActions); |
|
exporterObservations = new Tool(Tool.PIN, new Function() { |
|
public void execute() { |
174,13 → 201,13 |
|
} ; |
|
etatObservation = new ColumnConfig("Transmis", "etat_observation", 60, true, new Renderer() { |
etatObservation = new ColumnConfig("Transmis", "etat_observation", 20, true, new Renderer() { |
|
public String render(Object value, CellMetadata cellMetadata, |
Record record, int rowIndex, int colNum, Store store) { |
if(value.equals("1")) |
{ |
return "<input type=\"checkbox\" checked =\"checked\" disabled=\"disabled\" />" ; |
return "<img src=\"tela.png\"/></img>" ; |
} |
else |
{ |
278,25 → 305,20 |
|
}); |
|
|
/*this.getSelectionModel().addListener(new RowSelectionListenerAdapter() { |
this.addListener(new PanelListenerAdapter() { |
public void onRender(Component c) { |
|
ExtElement lienExport = Ext.get("lienExport") ; |
lienExport.addListener("click", new EventCallback() { |
|
// gestion de la sélection |
|
public void onSelectionChange(RowSelectionModel sm) { |
|
// si on a rien de sélectionné |
if (sm.getCount() <= 0) { |
// on notifie le médiateur (qui désactive notamment l'accès à certaines infos) |
// getobservationMediateur().aucuneSelection(); |
} else { |
// sinon on notifie le médiateur |
// getobservationMediateur().selection(); |
// et on lui demande de synchroniser la selection avec les autres vues |
// getobservationMediateur().synchroniserSelection("liste"); |
} |
public void execute(EventObject e) { |
|
observationMediateur.exporterObservations(); |
} |
|
}); |
} |
});*/ |
}); |
} |
|
/** |