Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    optionDataSource with ListGrid does not fetch

    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
    Last edited by sindroide; 16 Jul 2010, 18:45.

    #2
    maybe this is obvious to resolv for you, but you consider that it's obvious I can't find a solution for this.
    Given a runnable test sample... reading everywhere .. I got no other choice that ask you for help, as this is not some "please write my code for me"

    thanks

    Comment


      #3
      Your URL has spaces, that's not valid.

      Comment


        #4
        thanks a lot for your replay but even removing spaces still does not fetch, of course i did any kind of possible combination before write again

        tried shorter name for my js file
        tried with and without valueField, displayField, autoFetchDisplay

        anyway.. why would be working with SelectItem despite I was using js file with spaces?

        I know that the app is not even tring to call any js file to load and fetch

        Comment


          #5
          please try sample test without spaces and correct me if i'm wrong but it does not work
          thanks ;)

          Comment

          Working...
          X