From bec0f2e4e0f19841ffd9365c15855a497595b72d Mon Sep 17 00:00:00 2001 From: Tony Wang Date: Mon, 29 Sep 2014 15:17:16 +0800 Subject: [PATCH] Update README.md --- README.md | 153 +++++++++++++++++++++++++++--------------------------- 1 file changed, 77 insertions(+), 76 deletions(-) diff --git a/README.md b/README.md index 504225d..bcb354e 100644 --- a/README.md +++ b/README.md @@ -26,44 +26,44 @@ angular #### sorting there is no new configuration add in this module, to enable sorting feature, you only need to follow the setup of the footable * include footable.sort.js in your app - ```html - - ``` +```html + +``` * configure in the table header - ```html - - - - ID - - - First Name - - - Last Name - - - Job Title - - - DOB - - - Status - - - - ``` +```html + + + + ID + + + First Name + + + Last Name + + + Job Title + + + DOB + + + Status + + + +``` #### filtering data * include footable.sort.js - ```html - - ``` +```html + +``` * basic filter - ```html - - - ``` +```html + +
+``` * custom filter * in the view ```html @@ -77,51 +77,52 @@ angular
``` * in the controller - ```javascript - .controller('exampleCtrl', function($scope) { - $scope.clearFilter = function() { - $('.filter-status').val(''); - $('.footable').trigger('footable_clear_filter'); - }; - - $scope.filteringEventHandler = function(e) { - var selected = $('.filter-status').find(':selected').text(); - if (selected && selected.length > 0) { - e.filter += (e.filter && e.filter.length > 0) ? ' ' + selected : selected; - e.clear = !e.filter; - } - }; - - $scope.filterByStatus = function() { - $('.footable').trigger('footable_filter', { - filter: $('#filter').val() - }); - }; - - $scope.filter = { - status: null - }; - }) - ``` -#### paginating table is very easy, follow the demo page of footable is enough +```javascript +.controller('exampleCtrl', function($scope) { + $scope.clearFilter = function() { + $('.filter-status').val(''); + $('.footable').trigger('footable_clear_filter'); + }; + + $scope.filteringEventHandler = function(e) { + var selected = $('.filter-status').find(':selected').text(); + if (selected && selected.length > 0) { + e.filter += (e.filter && e.filter.length > 0) ? ' ' + selected : selected; + e.clear = !e.filter; + } + }; + + $scope.filterByStatus = function() { + $('.footable').trigger('footable_filter', { + filter: $('#filter').val() + }); + }; + + $scope.filter = { + status: null + }; + }) +``` +#### paginating + paginate table is very easy, follow the demo page of footable is enough * load foot.paginate.js into your app - ```html - - ``` +```html + +``` * configure the page size on the table element - ```html -
- ``` +```html +
+``` * add the pagination bar in the table foot - ```html - - - - - - ``` +```html + + + + + +``` License -------
-
    -
    +
      +