miniui autocomplete支持放大镜按钮(data-grid)

   <style type="text/css">
    html body .searchbox .mini-buttonedit-close
    {
        background:url(../buttonedit/search.gif) no-repeat 50% 50%;
    }
      
      
    html body .searchbox .mini-buttonedit-close:before
    {
        content:"";
    }    
    </style>


    <div id="datagrid1" class="mini-datagrid" style="width:800px;height:280px;" 
        url="../data/AjaxService.aspx?method=SearchEmployees" idField="id" 
        allowResize="true" pageSize="100" 
        allowCellEdit="true" allowCellSelect="true" multiSelect="true" 
        editNextOnEnterKey="true"  editNextRowCell="true"
        
    >
        <div property="columns">
           
              <div field="country" displayfield="country" width="100" headerAlign="center" >国家
          
                  <input class="mini-autocomplete searchbox"  property="editor"  style="100%;" textField="text" valueField="id" 
                                              url="../data/countrys.txt" value="cn" showNullItem="true" allowInput="true" showClose="true" oncloseclick="buttonclick"/>    
            </div>
       
         </div>   
            
    </div>

  

function buttonclick(e){
     
        
        var row = grid.getSelected();
        if (row){
        
           e.sender.setText("中国");
           e.sender.setValue("中国");
          
        }
 }

  

posted @ 2018-12-04 20:54  Ender.Lu  阅读(590)  评论(0编辑  收藏  举报