well after lots of tries to load datsource with listgridfield.setoptiondatasource I must ask what I'm doing wrong , because fetch does not occurs.
I leave one runnable test case sample, please help me.
public class Test extends ListGrid implements EntryPoint {
public void onModuleLoad() {
setHeight("100%");
setWidth("33%");
ListGridField primera = new ListGridField("Conceptos","Conceptos");
DataSource dataSource = new DataSource();
dataSource.setClientOnly(true);
dataSource.setDataFormat(DSDataFormat.JSON);
dataSource.setDataURL("Seres vivos concepto.js");
primera.setDisplayField("Conceptos");
primera.setValueField("Conceptos");
primera.setOptionDataSource(dataSource);
primera.setAutoFetchDisplayMap(true);
setFields(primera);
show();
}
}
Seres vivos conceptos.js
[
{Conceptos: "Ser vivo"},
{Conceptos: "Ciclo Vital"},
{Conceptos: "Desarrollo"},
{Conceptos: "Crecimiento"}
]
it's good to mention that
If I tried to load my js file with same datasource but using SelectItem works perfectly.
without needing to call setAutoFetchDisplayMap(true) or setDisplayField("Conceptos")... setValueField("Conceptos");
those methos I tried with listgrid just in case... I also set autofetch true or call fetchdata to datasource... withouth success
I only can populate my listgrid calling datasource.fetchData(null, new DSCallback(){...}
wich is not the idea... I think optionDataSource can save me write some code...
Thanks you so much for your correction in this test case.
I'm using smartgwt 2.1 with gwt 1.7 and also tried gwt 2
I leave one runnable test case sample, please help me.
public class Test extends ListGrid implements EntryPoint {
public void onModuleLoad() {
setHeight("100%");
setWidth("33%");
ListGridField primera = new ListGridField("Conceptos","Conceptos");
DataSource dataSource = new DataSource();
dataSource.setClientOnly(true);
dataSource.setDataFormat(DSDataFormat.JSON);
dataSource.setDataURL("Seres vivos concepto.js");
primera.setDisplayField("Conceptos");
primera.setValueField("Conceptos");
primera.setOptionDataSource(dataSource);
primera.setAutoFetchDisplayMap(true);
setFields(primera);
show();
}
}
Seres vivos conceptos.js
[
{Conceptos: "Ser vivo"},
{Conceptos: "Ciclo Vital"},
{Conceptos: "Desarrollo"},
{Conceptos: "Crecimiento"}
]
it's good to mention that
If I tried to load my js file with same datasource but using SelectItem works perfectly.
without needing to call setAutoFetchDisplayMap(true) or setDisplayField("Conceptos")... setValueField("Conceptos");
those methos I tried with listgrid just in case... I also set autofetch true or call fetchdata to datasource... withouth success
I only can populate my listgrid calling datasource.fetchData(null, new DSCallback(){...}
wich is not the idea... I think optionDataSource can save me write some code...
Thanks you so much for your correction in this test case.
I'm using smartgwt 2.1 with gwt 1.7 and also tried gwt 2
Comment