Announcement

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

    How to create ListGridRecord from a datasource

    Hi all,
    Apologies upfront for a dumb question.
    I'm trying to recreate the following showcase example using a datasource:
    http://www.smartclient.com/smartgwt/...m_editing_cell
    Code:
    private ListGridRecord[] getData() {  
            return new ListGridRecord[]{  
                    new NameValueRecord(1, "String Editor", "some string"),  
                    new NameValueRecord(2, "Password Editor", "donkeykong"),  
                    new NameValueRecord(3, "Date Editor", new Date()),  
                    new NameValueRecord(4, "Boolean Editor", Boolean.FALSE),  
                    new NameValueRecord(5, "Masked Int Editor", 5),  
                    new NameValueRecord(6, "SelectItem Editor", "Dog"),  
                    new NameValueRecord(7, "Slider Editor", 7)  
            };  
        }
    I'm unable to replace the code above with data from a datasource (Coming from a MySql Database).
    I've successfully populated the list grid from this example:
    http://www.smartclient.com/smartgwt/...id_editing_row (Using my datasource)
    Any help will be useful to beginners like me.
    Thanks in advance.
    Last edited by kinghorn; 3 Jan 2013, 14:28.

    #2
    ListGrid.setDataSource() maybe?

    Or if you want to customize your ListGridFields - use DataSource.get("dsname").getFields() and then create an array of ListGridFields on the basis of getFields result.

    Or better read Quick Start Guide. It's all covered there.

    Comment


      #3
      Thank you Vostapenko

      Dear Vostapenko,
      Thank you for your reply. I'm trying to travel in the direction pointed by you. However, this looks like a bit complicated for new comers.
      Dear Isomorphic,
      Kudos for an excellent product. The showcase is absolutely mind blowing. May I request you to look into this please:
      1) http://www.smartclient.com/smartgwt/showcase/#grid_custom_editing_cell
      2) http://www.smartclient.com/smartgwt/showcase/#grid_cell_widgets

      In both the above examples, you've used a hard coded data source. Please, consider my request updating one of the examples where "Records" can be created from a dynamic data source. It'll help many more like me.

      Thanks in advance.

      Comment

      Working...
      X