Hi. I have a datasource, and one of the fields (called 'screenshot') is in my datasource. The field is a varchar with the URL.
I tried to *not* create all the ListGridFields in the constructor, but rather let the SmartGWT code determine the fields itself from the datasource XML(which is a great feature!). Since I need to specify this field as type Image, I added an onDraw handler, and used the following code:
Unfortunately, the field still shows as a text field, with the values of the image names ('abc.gif', etc.).
What am I doing wrong? The table (datasource) has many fields, and I'd prefer not creating each one as a ListGridField and then adding them all to the ListGrid, if possible...
Thanks.
-Ken
I tried to *not* create all the ListGridFields in the constructor, but rather let the SmartGWT code determine the fields itself from the datasource XML(which is a great feature!). Since I need to specify this field as type Image, I added an onDraw handler, and used the following code:
Code:
ListGridField screenshotField = myGrid.getField("screenshot"); screenshotField.setType(ListGridFieldType.IMAGE); screenshotField.setImageSize(65); screenshotField.setImageURLPrefix("http://mywebsite/images/");
What am I doing wrong? The table (datasource) has many fields, and I'd prefer not creating each one as a ListGridField and then adding them all to the ListGrid, if possible...
Thanks.
-Ken
Comment