smartgwt 使用心得

1. 列表中根据值显示可以点击操作的图标,参考showcase中的 Grids/ Grid cell widgets

          重写ListGrid的createRecordComponent(final ListGridRecord record, Integer colNum)方法


2.显示带图标的下拉框,参考showcase ComboBox & Family/ Styled ComboBox


3. SelectItem出现意外的值undefined

selectItem.setAutoFetchData(false)

参考:http://forums.smartclient.com/showthread.php?t=20272

I found out that the SelectItem (or PickListMenu) sends additional request to the server through the DataSource that is set to a ValuesManager by valuesManager.setDataSource(dataSource); and the DynamicForm "form" this SelectItem belongs to is set to this valuesManager by valuesManager.addMember(form). The request looks like that:
componentId isc_PickListMenu_0
_dataSource isc_PagedRestDataSource_3
_endRow 75
_operationType fetch
_startRow 0
_textMatchStyle startsWith
isc_dataFormat json
isc_metaDataPrefix _

It looks like the data retrieved by this request are combined with the valueMap I set for that selectItem.

As soon as I added the selectItem.setAutoFetchData(false); this additional request vanished and all the unwanted options as well.
Could you confirm that what I did is what is correct that should be done in this case?
Reply With Quote

 

设置HTMLPane内嵌页面高度

HTMLPane内嵌页面在谷歌或火狐下高度会缩小,而不是充满整个容器

解决办法,重写HTMLPane onDraw方法,得到内嵌元素并设置其高度

protected void onDraw(){
  Element el = DOMUtil.getDOM();
  el.setAttribute("style", "height:100%");
}
注意,div不能直接设置height=100%,其不支持height属性,必须设置到style中


设置Form表单内控件的宽度

其中item设置setWidth("*")

form.setColWidths(new Object[]{100,100,200});

如此item可充满所设宽度

你可能感兴趣的:(smartgwt)