if(void 0===MMONIT||!MMONIT)var MMONIT={};MMONIT.datatable={},MMONIT.datatable.search=function(){return this.shouldApplyClientSearch=!1,this.shouldRefreshCache=!1,{client:function(e,t,a,r){var l=-1,n=[],h=$("#"+a);e.subscribe("rowDeleteEvent",(function(e){for(var t=0;t<n.length;t++)if(e.oldData.id==n[t].id){n.splice(t,1);break}}));var o=function(){MMONIT.datatable.search.shouldRefreshCache&&(MMONIT.datatable.search.shouldRefreshCache=!1,n=[]),0===n.length&&function(){for(var t=e.getRecordSet().getRecords(),a=0;a<t.length;a++)n[n.length]=t[a].getData()}(),MMONIT.datatable.search.shouldApplyClientSearch=!1,e.getRecordSet().replaceRecords(n);for(var a=[],l=e.getRecordSet(),o=l.getRecords(),c=null,s=0;s<o.length;s++)(c=o[s].getData())[t].toLowerCase().indexOf(h.val().toLowerCase())>=0&&(a[a.length]=c);a.length<o.length&&l.replaceRecords(a);var d=e.get("paginator");d&&d.set("totalRecords",a.length),e.render(),r&&r(h.val().length>0?a.length:0)};e.subscribe("beforeRenderEvent",(function(e){MMONIT.datatable.search.shouldApplyClientSearch&&""!=h.val()&&(MMONIT.datatable.search.shouldApplyClientSearch=!1,o())})),h.on("keyup",(function(e){13==e.which?$(e.target).blur():(-1!=l&&(l=-1,clearTimeout(l)),l=setTimeout(o,300))}))}}}();