亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在表中如何使用角度 9 中的按鈕啟用和禁用 Bootstrap 復選框?

在表中如何使用角度 9 中的按鈕啟用和禁用 Bootstrap 復選框?

一只甜甜圈 2023-10-14 15:45:02
我正在開發一個有角度的頁面。我對角度不太熟悉。我花了幾個小時來研究它,并瀏覽了有關此問題的最大數量的備用線程。但找不到我正在研究的解決方案。具體來說,我想在這里強調我正在使用引導復選框。我沒有使用 ng-bootstrap。以下是我想解決的問題。當頁面加載時,按鈕應該被禁用,直到我單擊復選框。當我單擊表標題中的復選框時,它應該啟用表中的所有復選框并啟用按鈕。當我取消選中標題中的復選框時,它應該禁用所有其他復選框并禁用按鈕。以下是我為解決問題所做的詳細信息。我的頁面.html   <div id='bookstore'>            <table  class="table table-responsive table-striped">                <thead class="th-color">                    <tr>                        <th><input name="select_all_books" type="checkbox" ></th>                        <th class="theading">Book ID</th>                        <th class="theading">Book Name</th>                        <th class="theading">From Date</th>                        <th class="theading">To Date</th>                        <th class="theading">No of Days</th>                        <th class="theading">Apply Date</th>                        <th class="theading">Reason</th>                        <th class="theading">Book Status</th>                                           </tr>                </thead>                <tbody>                    <tr *ngFor="let data of bookstore | paginate: { itemsPerPage: pageSize, currentPage: p}">                        <td><input type="checkbox" id="rowcheckedbookstore"></td>                        <td> {{data.BookId }}</td>                        <td>{{ data.BookName }}</td>                        <td>{{ data.BookStart | date:'dd-MM-yyyy' }}</td>                        <td>{{ data.BookReturn  | date:'dd-MM-yyyy' }}</td>                        <td>{{ data.BookDays }}</td>                        <td>{{ data.ApplyDate}}</td>                        <td>{{ data.Reason }}</td>                        <td>{{ data.BookStatus}}</td>                                     </tr>                </tbody>                </table>                </div>我可以禁用頁面加載上的按鈕。但當我嘗試使用復選框時,我無法實現。我想知道我怎樣才能實現?
查看完整描述

1 回答

?
森欄

TA貢獻1810條經驗 獲得超5個贊

當頁面加載時,按鈕應該被禁用,直到我單擊復選框。

<input disabled ng-disabled="name == '' || password == ''" type="submit" value="Log in" />

about 代碼解決了我禁用 ng 的問題。


查看完整回答
反對 回復 2023-10-14
  • 1 回答
  • 0 關注
  • 150 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號