JQuery Initialization on Listings Pages: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 41: | Line 41: | ||
*[[Sorting Listings|configuration notes for sorting]] | *[[Sorting Listings|configuration notes for sorting]] | ||
[[Category:CMS Documentation]] | [[Category:CMS Documentation]] | ||
[[Category:JQuery/AJAX]] | |||
Revision as of 13:07, 28 February 2012
Listings bindListingsHandlers()
LITTLED.Listings.bindListingsHandlers(parent_selector)parent_selectortargets the element containing the listings- Inline edits:
.inline-edit-celldouble-click - Pagination & paging button handlers (
.page-btn) - Update cache:
.update-cache-btnclick - Delete records:
.trash-btnclick - Makes button icons for the following elements:
.details-btn,.preview-btn,.edit-btn,.print-btn,.update-cache-btn,.trash-btn. - Button element handlers should persist after listings content is refreshed.
bindListingsHandlers()in turn callesbindListingsButtons(). The two routines are separated sobindListingsHandlers()doesn't need to be called multiple times to avoid attaching duplicate handlers to listings elements.- This routine does not refresh the handlers or buttons after the listings are refreshed. This can be achieved with
$(document).ready(function() {
LITTLED.Listings.bindListingsHandlers();
LITTLED.init({setSortables: LITTLED.Listings.bindListingsButtons});
});
Keyword bindListingsHandlers()
LITTLED.Keyword.bindListingsHandlers(parent_selector)parent_selectortargets the element containing the listings- Loading inline editor:
.edit-kw-btnclick - Submitting and canceling inline edits:
.kw-commit-btnand.kw-cancel-btnclick - Button icons:
.ui-icon-edit bindListingsHandlers()in turn callesbindListingsButtons(). The two routines are separated sobindListingsHandlers()doesn't need to be called multiple times to avoid attaching duplicate handlers to listings elements.- Button element handlers should persist after listings content is refreshed.
- The routine doesn't handle refreshing the button elements when the listings content is refreshed.
Keyword filter autocomplete
LITTLED.Gallery.keywordAutocomplete()
Datepicker
$('.datepicker').datepicker();