如何为{{selectmenu}}标签

时间:2018-11-30 05:20:46

标签: jsviews jquery-ui-selectmenu

我正在寻找一个示例,可以在其中指定用于渲染选项的模板,以便可以将选项渲染为两个部分:具有背景色和值的span。

与此https://jqueryui.com/selectmenu/#custom_render

相同

jsviews标记实现中支持吗?

非常感谢。

1 个答案:

答案 0 :(得分:1)

可能还有其他方法,包括制作自己的自定义标签-不使用jQuery UI,或创建func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let categoryInfo = self.categories[indexPath.row] as! [String : AnyObject] let size = self.widthOfString(string: categoryInfo["name"] as! String) return CGSize(width: size.width + 12, height: size.height + 2) } 标签控件here{{selectmenu}}的派生版本(使用{{ 3}})。

但这是一种建议的快速建议:

{{myselectmenu}}

数据:

{^{selectmenu person name="person" onBind=~onbind}}
  {^{for people}}
    <option data-style="{{:style}}" value="{{:id}}">{{:name}}</option>
  {{/for}}
{{/selectmenu}}

代码:

people: [
  {name: "John Resig", id: "1", style: "background-image: url(...);"},
  ...
相关问题