JQuery Initialization on Listings Pages: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with " ==<code>LITTLED.Listings.bindListingsHandlers(parent_selector)</code>== *<code>parent_selector</code> targets the element containing the listings *Inline edits: <code>.inlin...")
 
No edit summary
Line 1: Line 1:
 
==Listings bindListingsHandlers()==
 
*<code>LITTLED.Listings.bindListingsHandlers(parent_selector)</code>
==<code>LITTLED.Listings.bindListingsHandlers(parent_selector)</code>==
*<code>parent_selector</code> targets the element containing the listings
*<code>parent_selector</code> targets the element containing the listings
*Inline edits: <code>.inline-edit-cell</code> double-click
*Inline edits: <code>.inline-edit-cell</code> double-click
Line 18: Line 17:
</syntaxhighlight>
</syntaxhighlight>


==Keyword bindListingsHandlers()==


==<code>LITTLED.Keyword.bindListingsHandlers(parent_selector)</code>==
*<code>LITTLED.Keyword.bindListingsHandlers(parent_selector)</code>
 
*<code>parent_selector</code> targets the element containing the listings
*<code>parent_selector</code> targets the element containing the listings
*Loading inline editor: <code>.edit-kw-btn</code> click
*Loading inline editor: <code>.edit-kw-btn</code> click
Line 29: Line 28:
*The routine doesn't handle refreshing the button elements when the listings content is refreshed.  
*The routine doesn't handle refreshing the button elements when the listings content is refreshed.  


==Keyword filter autocomplete==
*<code>LITTLED.Gallery.keywordAutocomplete()</code>


==Datepicker==
==Datepicker==
Line 35: Line 37:
$('.datepicker').datepicker();
$('.datepicker').datepicker();
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
*[[Sorting Listings|configuration notes for sorting]]
*[[Sorting Listings|configuration notes for sorting]]
[[Category:CMS Documentation]]
[[Category:CMS Documentation]]

Revision as of 22:58, 20 February 2012

Listings bindListingsHandlers()

  • LITTLED.Listings.bindListingsHandlers(parent_selector)
  • parent_selector targets the element containing the listings
  • Inline edits: .inline-edit-cell double-click
  • Pagination & paging button handlers (.page-btn)
  • Update cache: .update-cache-btn click
  • Delete records: .trash-btn click
  • 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 calles bindListingsButtons(). The two routines are separated so 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() {
	LITTLED.Listings.bindListingsHandlers();
	LITTLED.init({setSortables: LITTLED.Listings.bindListingsButtons});
});

Keyword bindListingsHandlers()

  • LITTLED.Keyword.bindListingsHandlers(parent_selector)
  • parent_selector targets the element containing the listings
  • Loading inline editor: .edit-kw-btn click
  • Submitting and canceling inline edits: .kw-commit-btn and .kw-cancel-btn click
  • Button icons: .ui-icon-edit
  • bindListingsHandlers() in turn calles bindListingsButtons(). The two routines are separated so 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

  • LITTLED.Gallery.keywordAutocomplete()

Datepicker

$('.datepicker').datepicker();

See Also