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可充满所设宽度

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值