需求如下:
 
根据porduct列选择的类型,动态更改List Price列的编辑属性类型。
porduct列选择的类型有"numberbox","combobox","datebox",
己知绑定onSelect方法可能获取到当前选择的类型,请问如何动态绑定,谢谢!

解决方案 »

  1.   

    看看这篇文章,可以解决你的问题
    http://www.easyui.info/archives/623.html
      

  2.   

    easyui没有提供动态更改editor的功能,你可以自己获取到list price编辑器的容器,然后清空容器内容,然后依据product列选中的内容自己将对应的插件生成到list pirce编辑器容器里面var ed = $(this).datagrid('getEditor', {index:'编辑的行下标',field:'列名称'});
    var p=$(ed.target).closest('td[field]');//编辑器容器
    p.html('');//删除原来的编辑器
    //依据product选中的内容生成对应的对象
    if(value=='xxxx')p.datebox({xxxxxxx})
    else p.numberbox({xxxxxx})
    //.....