grid icon smart gwt - icono en grid
grid icon smart gwt
GRID- icon.txt
ListGridField removeField = new ListGridField ("removeAction", 20);
removeField.setType (ListGridFieldType.ICON);
removeField.setCellIcon (str_img_del2);
removeField.setCanEdit (false);
removeField.setCanFilter (true);
removeField.setFilterEditorType (new SpacerItem ());
removeField.setCanGroupBy (false);
removeField.setCanSort (false);
removeField.addRecordClickHandler (new RecordClickHandler () {
public void onRecordClick (final RecordClickEvent event) {
// Detecta si es nuevo o modificado segun el id
String id = event.getRecord().getAttribute("idccdir");
if ((id == null) || (id.equals("") || (id.isEmpty()))) {
// ES NUEVO
GridSource.removeData(event.getRecord());
} else {
// ES MODIFICADO
Record record = new Record();
record.setAttribute("1", id);
GridSource.cmd_data(record, null,
keyhash.str_m_mante1, keyhash.str_b_del,
new DSCallback() {
@Override
public void execute(
DSResponse response,
Object rawData,
DSRequest request) {
// TODO Auto-generated method stub
load_data();
}
});
}
}
});
icono en grid
GRID- icon.txt
ListGridField removeField = new ListGridField ("removeAction", 20);
removeField.setType (ListGridFieldType.ICON);
removeField.setCellIcon (str_img_del2);
removeField.setCanEdit (false);
removeField.setCanFilter (true);
removeField.setFilterEditorType (new SpacerItem ());
removeField.setCanGroupBy (false);
removeField.setCanSort (false);
removeField.addRecordClickHandler (new RecordClickHandler () {
public void onRecordClick (final RecordClickEvent event) {
// Detecta si es nuevo o modificado segun el id
String id = event.getRecord().getAttribute("idccdir");
if ((id == null) || (id.equals("") || (id.isEmpty()))) {
// ES NUEVO
GridSource.removeData(event.getRecord());
} else {
// ES MODIFICADO
Record record = new Record();
record.setAttribute("1", id);
GridSource.cmd_data(record, null,
keyhash.str_m_mante1, keyhash.str_b_del,
new DSCallback() {
@Override
public void execute(
DSResponse response,
Object rawData,
DSRequest request) {
// TODO Auto-generated method stub
load_data();
}
});
}
}
});
icono en grid
Comments
Post a Comment