<div><div id="${id}"  <#if class??> class="${class!}" </#if>  <#if style??> style="${style!}" </#if> ></div></div>
<script>
    var config = ${config};
    (function(config){
        config.filterable = {
//    extra: false
            messages:{
                filter: "过滤",
                clear: "清除",
                isFalse: "False",
                isTrue:"True",
                info: "显示符合以下条件的行",
                checkAll: "全选"
            }
        };
        config.columns.forEach(function(o){
            if(o.filterable  && o.template){
                o.filterable = false;
            }
//        if(o.filterable){
//            var dataSourceArr = [];
//            config.dataSource.data().forEach(function(obj){
//                dataSourceArr.push(obj[o.field]);
//            });
//            o.filterable = {
//                ui:function (element) {
//                    element.kendoAutoComplete({
//                        dataSource: dataSourceArr
//                    });
//                }
//            }
//        }
        });
        var fieldsModel = config.dataSource.options.schema;
        if(fieldsModel.model && fieldsModel.model.fields){
            var fieldsOb = fieldsModel.model.fields;
            for(var o in fieldsOb){
                if(fieldsOb.hasOwnProperty(o) && fieldsOb[o]['type'] === 'boolean' && fieldsOb[o]['checkedValue']){
                    config.columns.forEach(function(fo,index){
                        if(fo.field === o){
                            eval("var dataSource = [{"+fo.field+":'"+fieldsOb[o]['checkedValue']+"'},{"+fo.field+":'"+fieldsOb[o]['uncheckedValue']+"'}]");
                            config.columns[index].filterable = {
                                multi:true,
                                dataSource:dataSource
//                      itemTemplate: function(e) {
//                          return "<span><label><span>#= data.systemFlag|| data.all #</span><input type='checkbox' name='" + e.field + "' value='#= data.systemFlag#'/></label></span>"
//                      }
                            }
                        }
                    });
                }
            }
        }
    })(config);

    $("#${id}").kendoGrid(config);
    <#if bindModel??>
    kendo.bind($("#${id}"), ${bindModel!});
    </#if>
</script>