Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cb604b36

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID cb604b36f816c09f2a0ebef6a3d40004b7eb2310
  • Vorgänger d851523e
  • Nachfolger b2b1edc8

L.sortable_element: beliebige POST-Parameter mit 'params' übergeben können

Unterschiede anzeigen:

SL/Template/Plugin/L.pm
my $filter = ".filter(function(idx) { return this.substr(0, " . length($params{with}) . ") == '$params{with}'; })";
$filter .= ".map(function(idx, str) { return str.replace('$params{with}_', ''); })";
my $params_js = $params{params} ? qq| + ($params{params})| : '';
$stop_event = <<JAVASCRIPT;
\$.post('$params{url}', { '${as}[]': \$(\$('${selector}').sortable('toArray'))${filter}.toArray() });
\$.post('$params{url}'${params_js}, { '${as}[]': \$(\$('${selector}').sortable('toArray'))${filter}.toArray() });
JAVASCRIPT
}
......
recolor the children by setting the class C<listrow0> on odd and
C<listrow1> on even entries.
=item C<params>
An optional JavaScript string that is evaluated before sending the
POST request. The result must be a string that is appended to the URL.
=back
Example:

Auch abrufbar als: Unified diff