From 38283296471234e64d4d6a39581f637937511799 Mon Sep 17 00:00:00 2001 From: Mateus Giuliano Date: Fri, 4 Mar 2016 16:47:48 -0300 Subject: [PATCH 1/2] Convert inputs of entity HTML to simble To use the lib with reactJs is required to replace the HTML entity code to string, before replace the template. Ref #124 In JSX I can't use the "<%=" token, therefore I need convert to HTML entity code("<%=") and after convert again. --- dist/filter.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(\'' + From abffc2ff6a88cf16b3558e9c0b3f954af109c252 Mon Sep 17 00:00:00 2001 From: Mateus Giuliano Date: Thu, 17 Mar 2016 13:47:06 -0300 Subject: [PATCH 2/2] Callback Paginator Hi, I needed insert callbacks before and after to change page when clicked in paginator. After this I decided send the development to you and I hope that you add in project. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) 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. } }; ```