$('#modalSetDonationsProducts').on('show.bs.modal', function (e) {
alert("dljasld");
rowNumber = 1;
$('#tblEmployees tbody tr').remove("tr:gt(0)");
alert("enterd");
var itemname = $(this).parent().parent().find(rowData["ItemName"]).val()
alert(itemname);
$(e.currentTarget).find('input[name="item"]').val(itemName);
$(e.currentTarget).find('input[name="description"]').val(itemName);
$(e.currentTarget).find('input[name="item"]').enabled = false;
});
Ich habe diese Funktion und modalmodal kann seine Show nicht Funktion zugreifen
<div class="modal modal-flex " id="modalSetDonationsProducts">
<div class="modal-dialog" style="min-width: 900px; max-width:1000px;width:auto">
<div class="modal-content">
<div class="modal-header" style="width:100%;">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span> <span class="sr-only">Close</span></button>
<h4 class="modal-title"> <%= GetLocalResourceObject("addnewitem")%></h4>
</div>
<div class="modal-body">
<p><%= GetLocalResourceObject("addnewitem")%></p>
<div class="table-responsive">
<table class="table" id="tblEmployees">
<thead>
<tr>
<th>#</th>
<th></th>
</tr>
</thead>
<tbody>
<tr id="rowID1">
<td>1</td>
<td>
<input type="text" style="min-width:230px" readonly="readonly" name="item" value="" /></td> </tr>
</tbody>
</table>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"></button>
<button type="button" onclick="SaveProducts();" class="btn btn-green ladda-button">
</button>
</div>
</div>
</div>
</div>
ich modal nennen dieses
<a data-toggle=\"modal\" href=\"#modalSetDonationsProducts\" class=\"btn btn-green\" name=\"btnSplit\">add</a>
Was bereits geschehen ist:
1. model open Correctly . 2. it can't access the $('#modalSetDonationsProducts').on('show.bs.modal', function (e) and show the first alert at least . 3. my modal call by button from another table and I just want to set the input name="item" by parent.find way.
wie es scheint, haben Sie verpasst haben, ',' Semikolon ('alert (" dljasld ")'), aufgrund dessen es weiter zur Ausführung Ihres onShowOfModal-Ereignisses vorgeht. – ameenulla0007
Ich denke, es hat keine Wirkung, oder meinst du anderen –
Sie sollten Titel und href nicht entkommen, wenn das ist, wie Ihr HTML aussieht. –