, wie Ansichtsvariablenwert in Javascript ändern. Ich meine, wenn ich April aus der Dropdown-Tabelle wähle, werden nur die Daten des Aprils angezeigt, und die aktuellen Tabellendaten werden verschwinden und aktualisiert. Wie kann ich es tun? Helfen Sie mir
Mein JSwie man Ansichtsvariable in js der Schienen ändert
:javascript
var updateMonth = function(){
var month_id = $("#select_other_month").val();
console.log(month_id)
}
hier ist mein Tag select (Dropdown)
%select{:name => "options", :id=>"select_other_month",:onchange=>"updateMonth()"}
%option.placeholder{:disabled => "", :selected => "", :value => ""} see other months
%option{:value => "0"} this month
[email protected]_month - 1.month
%option{:value => "5"}=a.strftime('%Y-%m')
[email protected]_month - 2.month
%option{:value => "4"}=b.strftime('%Y-%m')
[email protected]_month - 3.month
%option{:value => "3"}=c.strftime('%Y-%m')
[email protected]_month - 4.month
%option{:value => "2"}=d.strftime('%Y-%m')
[email protected]_month - 5.month
%option{:value => "1"}=e.strftime('%Y-%m')
und meine Tabelle sieht wie folgt aus
.table{:id=>"time_table"}
%table{:border=>"1"}
%thead
%tr
%th No
%th Name
-(@[email protected]_end_of_month).each do |day|
-if (day.saturday? || day.sunday?)==false
%th=day.strftime("%d")
%th Total days
%th Total time
ich meine @xmonth wollen ändern vairable aus JS
Hinweis: @this_month = Date.today
Sie möchten frische Daten vom Server abrufen und auffüllen? – Kumar
Ja, ich bin. Was sollte ich jetzt tun? –