diff --git a/README.md b/README.md index 19c195a..498cc99 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,8 @@ Define callback in settings. Callbacks execute on different events. - `beforeRender` : Triggered before rendering going to call. - `beforeRecordRender` : Triggered for each JSON object record at time of rendering. - `afterFilter` : Triggered after filtering event. +- `beforeChangePage` : Triggered before change page of paginator. +- `afterChangePage` : Triggered after change page of paginator. i.e., @@ -189,6 +191,12 @@ i.e., }, afterFilter: function(result){ // i.e Update result counter, update google map markers. + }, + beforeChangePage: function(result) { + // i.e Delete a class to item. + }, + afterChangePage: function(result) { + // i.e Insert a class to item. } }; ``` diff --git a/dist/filter.js b/dist/filter.js index bd222a7..941d8cb 100644 --- a/dist/filter.js +++ b/dist/filter.js @@ -824,7 +824,17 @@ .replace(/\//g, '/'); }; + var convertHtmlEntityToStr = function(string) { + return (''+string).replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '\"') + .replace(/'/g, '\'') + .replace(///g, '\/'); + }; + function templateBuilder(str, data) { + str = convertHtmlEntityToStr(str); var c = templateSettings; var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' + 'with(obj||{}){__p.push(\'' +