diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f674b50..e6a5bee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ Feature Request Please search the issue list first to see if your feature has already been requested. All features are tagged with the tag `enhancement`. If there already -is an enchancement ticket, you can vote on it by putting in a +/-1 comment. If +is an enhancement ticket, you can vote on it by putting in a +/-1 comment. If you cannot find the `enhancement` you are looking for, you can open a new issue. Please prefix the subject line with **[Feature Request]** so your issue will @@ -64,13 +64,13 @@ Code Style ========== If you are filing a pull request, you should follow the guidelines below: -Javascript +JavaScript ---------- Please be aware that Backgrid.js uses 2 spaces for indentation. This project has a [.jshintrc](.jshintrc) file defined, which is handy if you use [jshint](http://www.jshint.com). In general, you should follow the -[Google Javascript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml). Backgrid.js's +[Google JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml). Backgrid.js's code follows this coding style extremely closely, with 2 exceptions: - `else` should be on its own line instead of the same line of the close `}` of @@ -107,10 +107,10 @@ Documentation ============= If you make any changes to the documentation, since Backgrid.js uses -[Github Pages](http://pages.github.com), please do so in your `gh-pages` branch +[GitHub Pages](http://pages.github.com), please do so in your `gh-pages` branch and submit a pull request from that branch. -If you change any Javascript comment documentation, you should rebuild the API +If you change any JavaScript comment documentation, you should rebuild the API document. There is also a Grunt task for this purpose, but make sure you have installed [JSDuck](https://github.com/senchalabs/jsduck) first. diff --git a/api/output/Backgrid.Extension.ClientSideFilter.js b/api/output/Backgrid.Extension.ClientSideFilter.js index c673d6f..ed2b52a 100644 --- a/api/output/Backgrid.Extension.ClientSideFilter.js +++ b/api/output/Backgrid.Extension.ClientSideFilter.js @@ -246,5 +246,5 @@ Ext.data.JsonP.Backgrid_Extension_ClientSideFilter({ "parentMixins": [ ], - "html": "
Hierarchy
Backgrid.Extension.ServerSideFilterBackgrid.Extension.ClientSideFilterSubclasses
ClientSideFilter is a search form widget that searches a collection for\nmodel matches against a query on the client side. The exact matching\nalgorithm can be overriden by subclasses.
\nA list of model field names to\nsearch for matches. If null, all of the fields will be searched.
\nThe HTML5 placeholder to appear beneath\nthe search box.
\nThe HTML5 placeholder to appear beneath\nthe search box.
\nThe time in milliseconds to wait since the last\nchange to the search box's value before searching. This value can be\nadjusted depending on how often the search box is used and how large the\nsearch index is.
\nDefaults to: 149
Clears the search box and reset the collection to its original.
\n\nIf the collection is a PageableCollection, clearing will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ServerSideFilter.clear
This default implementation takes a query string and returns a matcher\nfunction that looks for matches in the model's fields or all of its\nfields if fields is null, for any of the words in the query\ncase-insensitively using the regular expression object returned from
\n\nMost of time, you'd want to override the regular expression used for\nmatching. If so, please refer to the makeRegExp documentation,\notherwise, you can override this method to return a custom matching\nfunction.
\n\nSubclasses overriding this method must take care to conform to the\nsignature of the matcher function. The matcher function is a function\nthat takes a model as paramter and returns true if the model matches a\nsearch, or false otherwise.
\n\nIn addition, when the matcher function is called, its context will be\nbound to this ClientSideFilter object so it has access to the filter's\nattributes and methods.
\nThe search query in the search box.
\nA matching function.
\nConstructs a Javascript regular expression object for makeMatcher.
\n\nThis default implementation takes a query string and returns a Javascript\nRegExp object that matches any of the words contained in the query string\ncase-insensitively. Override this method to return a different regular\nexpression matcher if this behavior is not desired.
\nThe search query in the search box.
\nA RegExp object to match against model fields.
\nRenders a search form with a text box, optionally with a placeholder and\na preset value if supplied during initialization.
\nTakes the query from the search box, constructs a matcher with it and\nloops through collection looking for matches. Reset the given collection\nwhen all the matches have been found.
\n\nIf the collection is a PageableCollection, searching will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ServerSideFilter.search
Hierarchy
Backgrid.Extension.ServerSideFilterBackgrid.Extension.ClientSideFilterSubclasses
ClientSideFilter is a search form widget that searches a collection for\nmodel matches against a query on the client side. The exact matching\nalgorithm can be overridden by subclasses.
\nA list of model field names to\nsearch for matches. If null, all of the fields will be searched.
\nThe HTML5 placeholder to appear beneath\nthe search box.
\nThe HTML5 placeholder to appear beneath\nthe search box.
\nThe time in milliseconds to wait since the last\nchange to the search box's value before searching. This value can be\nadjusted depending on how often the search box is used and how large the\nsearch index is.
\nDefaults to: 149
Clears the search box and reset the collection to its original.
\n\nIf the collection is a PageableCollection, clearing will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ServerSideFilter.clear
This default implementation takes a query string and returns a matcher\nfunction that looks for matches in the model's fields or all of its\nfields if fields is null, for any of the words in the query\ncase-insensitively using the regular expression object returned from
\n\nMost of time, you'd want to override the regular expression used for\nmatching. If so, please refer to the makeRegExp documentation,\notherwise, you can override this method to return a custom matching\nfunction.
\n\nSubclasses overriding this method must take care to conform to the\nsignature of the matcher function. The matcher function is a function\nthat takes a model as parameter and returns true if the model matches a\nsearch, or false otherwise.
\n\nIn addition, when the matcher function is called, its context will be\nbound to this ClientSideFilter object so it has access to the filter's\nattributes and methods.
\nThe search query in the search box.
\nA matching function.
\nConstructs a JavaScript regular expression object for makeMatcher.
\n\nThis default implementation takes a query string and returns a JavaScript\nRegExp object that matches any of the words contained in the query string\ncase-insensitively. Override this method to return a different regular\nexpression matcher if this behavior is not desired.
\nThe search query in the search box.
\nA RegExp object to match against model fields.
\nRenders a search form with a text box, optionally with a placeholder and\na preset value if supplied during initialization.
\nTakes the query from the search box, constructs a matcher with it and\nloops through collection looking for matches. Reset the given collection\nwhen all the matches have been found.
\n\nIf the collection is a PageableCollection, searching will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ServerSideFilter.search
Hierarchy
Backgrid.Extension.ServerSideFilterBackgrid.Extension.ClientSideFilterBackgrid.Extension.LunrFilter
LunrFilter is a ClientSideFilter that uses lunrjs to\nindex the text fields of each model for a collection, and performs\nfull-text searching.
\nA hash of lunrjs index field names and boost\nvalue. Unlike ClientSideFilter#fields, LunrFilter#fields is required to\ninitialize the index.
Overrides: Backgrid.Extension.ClientSideFilter.fields
The HTML5 placeholder to appear beneath\nthe search box.
\nThe HTML5 placeholder to appear beneath\nthe search box.
\n`lunrjs` document reference attribute name.
\nDefaults to: "id"
The time in milliseconds to wait since the last\nchange to the search box's value before searching. This value can be\nadjusted depending on how often the search box is used and how large the\nsearch index is.
\nDefaults to: 149
Adds the given model to the index.
\nClears the search box and reset the collection to its original.
\n\nIf the collection is a PageableCollection, clearing will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ServerSideFilter.clear
Indexes the underlying collection on construction. The index will refresh\nwhen the underlying collection is reset. If any model is added, removed\nor if any indexed fields of any models has changed, the index will be\nupdated.
\n`lunrjs` document reference attribute name.
\nA hash of lunrjs index field names and\nboost value.
This default implementation takes a query string and returns a matcher\nfunction that looks for matches in the model's fields or all of its\nfields if fields is null, for any of the words in the query\ncase-insensitively using the regular expression object returned from
\n\nMost of time, you'd want to override the regular expression used for\nmatching. If so, please refer to the makeRegExp documentation,\notherwise, you can override this method to return a custom matching\nfunction.
\n\nSubclasses overriding this method must take care to conform to the\nsignature of the matcher function. The matcher function is a function\nthat takes a model as paramter and returns true if the model matches a\nsearch, or false otherwise.
\n\nIn addition, when the matcher function is called, its context will be\nbound to this ClientSideFilter object so it has access to the filter's\nattributes and methods.
\nThe search query in the search box.
\nA matching function.
\nConstructs a Javascript regular expression object for makeMatcher.
\n\nThis default implementation takes a query string and returns a Javascript\nRegExp object that matches any of the words contained in the query string\ncase-insensitively. Override this method to return a different regular\nexpression matcher if this behavior is not desired.
\nThe search query in the search box.
\nA RegExp object to match against model fields.
\nRemoves the given model from the index.
\nRenders a search form with a text box, optionally with a placeholder and\na preset value if supplied during initialization.
\nReindex the collection. If options.reindex is false, this method is a\nno-op.
Defaults to: true
Takes the query from the search box and performs a full-text search on\nthe client-side. The search result is returned by resetting the\nunderlying collection to the models after interrogating the index for the\nquery answer.
\n\nIf the collection is a PageableCollection, searching will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ClientSideFilter.search
Event handler. Show the clear button when the search box has text, hide\nit otherwise.
\nUpdates the index for the given model.
\nHierarchy
Backgrid.Extension.ServerSideFilterBackgrid.Extension.ClientSideFilterBackgrid.Extension.LunrFilter
LunrFilter is a ClientSideFilter that uses lunrjs to\nindex the text fields of each model for a collection, and performs\nfull-text searching.
\nA hash of lunrjs index field names and boost\nvalue. Unlike ClientSideFilter#fields, LunrFilter#fields is required to\ninitialize the index.
Overrides: Backgrid.Extension.ClientSideFilter.fields
The HTML5 placeholder to appear beneath\nthe search box.
\nThe HTML5 placeholder to appear beneath\nthe search box.
\n`lunrjs` document reference attribute name.
\nDefaults to: "id"
The time in milliseconds to wait since the last\nchange to the search box's value before searching. This value can be\nadjusted depending on how often the search box is used and how large the\nsearch index is.
\nDefaults to: 149
Adds the given model to the index.
\nClears the search box and reset the collection to its original.
\n\nIf the collection is a PageableCollection, clearing will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ServerSideFilter.clear
Indexes the underlying collection on construction. The index will refresh\nwhen the underlying collection is reset. If any model is added, removed\nor if any indexed fields of any models has changed, the index will be\nupdated.
\n`lunrjs` document reference attribute name.
\nA hash of lunrjs index field names and\nboost value.
This default implementation takes a query string and returns a matcher\nfunction that looks for matches in the model's fields or all of its\nfields if fields is null, for any of the words in the query\ncase-insensitively using the regular expression object returned from
\n\nMost of time, you'd want to override the regular expression used for\nmatching. If so, please refer to the makeRegExp documentation,\notherwise, you can override this method to return a custom matching\nfunction.
\n\nSubclasses overriding this method must take care to conform to the\nsignature of the matcher function. The matcher function is a function\nthat takes a model as parameter and returns true if the model matches a\nsearch, or false otherwise.
\n\nIn addition, when the matcher function is called, its context will be\nbound to this ClientSideFilter object so it has access to the filter's\nattributes and methods.
\nThe search query in the search box.
\nA matching function.
\nConstructs a JavaScript regular expression object for makeMatcher.
\n\nThis default implementation takes a query string and returns a JavaScript\nRegExp object that matches any of the words contained in the query string\ncase-insensitively. Override this method to return a different regular\nexpression matcher if this behavior is not desired.
\nThe search query in the search box.
\nA RegExp object to match against model fields.
\nRemoves the given model from the index.
\nRenders a search form with a text box, optionally with a placeholder and\na preset value if supplied during initialization.
\nReindex the collection. If options.reindex is false, this method is a\nno-op.
Defaults to: true
Takes the query from the search box and performs a full-text search on\nthe client-side. The search result is returned by resetting the\nunderlying collection to the models after interrogating the index for the\nquery answer.
\n\nIf the collection is a PageableCollection, searching will go back to the\nfirst page.
\nOverrides: Backgrid.Extension.ClientSideFilter.search
Event handler. Show the clear button when the search box has text, hide\nit otherwise.
\nUpdates the index for the given model.
\n