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可充滿所設寬度

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章