是否可以将跨度的标题分配给 php 变量?
我已将以下跨度添加到从数据库生成的表中:
while ($row = $database->fetch_array($result))
{
$i=1-$i;
$class = "row".$i;
echo "<tr class='{$class}' id='{$row['productId']}'>
<td > <span class='productId' title='{$row['productId']}' >". $row['category']."</span></td>
<td >" . $row['productNo']. "</td>
<td>" . $row['productName']. "</td>
<td class='edit'>" . intval($row['quantity']). "</td>
<td>" . $row['sfLf']. "</td>
<td>". $row['cost']. "</td>
<td>". $row['total']."</td>
</tr>";
}
现在,当我单击该跨度时,我希望弹出以下 jQuery UI 并显示与从我的数据库中的另一个表中单击的行关联的数据:
$(document).ready( function () {
//first we fade in the form when the button is clicked
var dialog = $("#editInventory").dialog({
autoOpen: false,
title: "Add New Order",
modal: true,
width: 780,
show: { effect: 'drop',direction:"up",duration:1000 },
hide: { effect: 'drop',direction:"down",duration:1000 },
buttons: {
'Submit':function() {
submitForm($("#addNewInvoice"));
},
'Cancel':function() {
$(this).dialog('close');
$("#container").fadeTo('slow',1);
}
}
});
$(".productId").click(function() {
dialog.dialog('open');
$("#container").fadeTo('slow',.4);
return false;
});
});