JQuery Initialization on Listings Pages: Difference between revisions
Jump to navigation
Jump to search
| Line 43: | Line 43: | ||
==See Also== | ==See Also== | ||
*[[Sorting Listings|configuration notes for sorting]] | *[[Sorting Listings|configuration notes for sorting]] | ||
*[[Refactoring a CMS to Use Shared LITTLED Libraries#Listings_pages|Refactoring a CMS to Use Shared LITTLED Libraries]] | |||
[[Category:CMS Documentation]] | [[Category:CMS Documentation]] | ||
[[Category:JQuery/AJAX]] | [[Category:JQuery/AJAX]] | ||
Revision as of 17:48, 24 March 2012
Listings bindListingsHandlers()
$('#listings-container').listings('bindListingsHandlers')$('#listings-container')targets the element containing the listings.#listings-containeris the most common element for this, but any appropriate selector can be specified.- 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.
$.listings('bindListingsHandlers')in turn calles$.listings('bindListingsButtons'). The two routines are separated so$.listings('bindListingsHandlers')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() {
$('#listings-container').listings('bindListingsHandlers');
LITTLED.init({setSortables: function() {
$('#listings-container').listings('bindListingsButtons');
}
});
});
Keyword bindListingsHandlers()
$('#listings-container').keywords('bindListingsHandlers')targets the element containing the listings. It's the most common element to use in this case, but any appropriate selector may be used.#listings-container- Loading inline editor:
.edit-kw-btnclick - Submitting and canceling inline edits:
.kw-commit-btnand.kw-cancel-btnclick - Button icons:
.ui-icon-edit $.keywords('bindListingsHandlers')in turn calles$.keywords('bindListingsButtons'). The two routines are separated so$.keywords('bindListingsHandlers')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
$(selector).galleries('keywordAutocomplete')
Datepicker
$('.datepicker').datepicker();