Я использую решение своего предыдущего вопроса, чтобы обновить таблицу после удаления строки. работает и хорошо освежает мой стол. но стиль и другие связанные js не работают. перед темобновить содержание таблицы. jquery ajax
//index.php
<div id="tableContainer">
<?php
include('table.php');
?>
</div>
// JQuery/Ajax
function deleteUser(id,thisObj){
$.ajax({
url: 'insert.php',
type: 'POST',
data: {'delAdmin':id}, // An object with the key 'submit' and value 'true;
success: function (result) {
$("#tableContainer").html(result);
}
});
}
//insert.php
/*Delete admin */
if(isset($_POST['delAdmin'])){
$idval=$_POST['delAdmin'];
$query="delete from admins where id=$idval";
$result=mysqli_query($dbCnn,$query) or die("خطا!");
} включает ('table.php');
//table.php
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html" />
<meta charset="utf-8" />
<!-- jquery ui -->
<link rel="stylesheet" href="js/ui/jquery-ui.min.css"/>
<script src="js/ui/jquery-ui.min.js"></script>
<!--activejs-->
<script src="js/activejs.js"></script>
<!--include font-awesome -->
<link rel="stylesheet" href="../fonts/awesome/css/font- awesome.min.css"/>
<!-- table paging and sorter -->
<script type='text/javascript' src='js/sortpager/dist/js/slimtable.min.js'></script>
<link rel='stylesheet' href='js/sortpager/css/slimtable.css'/>
</head>
<body>
<table id="usersListTable" style=" border:1px solid #00CCFF!important;" class="">
<thead>
<tr>
<th>ردیف</th>
<th>نام کاربری</th>
<th>کلمه عبور</th>
<th>رایانامه</th>
<th>سطح</th>
<th>فعال</th>
<th>آخرین ورود</th>
<th class="thBgNone"></th>
<th class="thBgNone"></th>
</tr>
</thead>
<tbody id="tb">
</tbody>
<?php
include("db_inc.php");
$usersQry="select * from admins";
$usersQryResult=mysqli_query($dbCnn,$usersQry);
$c=1;
while($user=mysqli_fetch_array($usersQryResult)){
echo"
<tr>
<td>$c<span class='userId' style='display:none'>$user[id]</span></td>
<td>$user[user]</td>
<td>$user[pass]</td>
<td>$user[email]</td>
<td>$user[level]</td>
<td>$user[status]</td>
<td>$user[lastlogin]</td>
<td><i onclick=\"editUser($user[id],this)\" class='fa fa-pencil-square-o' title='ویرایش اطلاعات کاربر'></i></td>
<td><i onclick=\"deleteUser($user[id],this)\" class='fa fa-trash-o deletUser' title='حذف کاربر' ></i></td>
</tr>
";
$c++;
}
?>
</table>
</body>
</html>
Можете ли вы разместить рендер? – Sibidharan
второе изображение в вопросе –