DataTables智能搜索

//智能搜索
"search": {
   "smart": true,
},                                                                                                                                                                                                                                                                                                                                                                                    

然后在某一个列属性里设置是否可以被搜索到

columns: [
   {
      defaultContent: '',
      searchable: false,
      //searchable: true,

      orderable: false,
      "render": function (a, b, c, d) {
         var moleNodeId = WORKFLOW.Actor.params.moleNodeId;
         var tenantId = c.ID;
         var flag = false;
         for (var item in WORKFLOW.Actor.tenantRelList) {
            if (WORKFLOW.Actor.tenantRelList[item].moleNodeId == moleNodeId && WORKFLOW.Actor.tenantRelList[item].tenantId == tenantId) {
               flag = true;
            }
         }
         if (flag) {
            return check = ''
         } else {
            return check = ''
         }
      }
   },
   {
      "data": "ID",
      visible: false,
      searchable: false,
   },

   {
      "data": "KEY",
      orderable: false,
      searchable: true,
      "render": function (a, b, c, d) {
         var transStr = '
+ 'white-space: nowrap;' + 'overflow: hidden; ' + 'width: 100px;"' + 'title=' + c.KEY + '>' + c.KEY + '
'
; // return c.KEY; return transStr; } }, { "data": "NAME", orderable: false, searchable: true, "render": function (a, b, c, d) { var transStr = '
+ 'white-space: nowrap;' + 'overflow: hidden; ' + 'width: 300px;"' + 'title=' + c.NAME + '>' + c.NAME + '
'
; // return c.NAME; return transStr; } }, ],
searchable为true即为可被搜索

你可能感兴趣的:(DataTables)