Zend Framework заменяет div другим div

У меня есть div (id = «first») и форма («search-form») на моей странице
div показывает всю запись моей таблицы в базе данных. В форме пользователь может ограничить результат своим текстом в форме. Я хочу заменить новый div на базовый.

Посмотреть:

 <div class="datagrid" id="first">
<table>
<tr>
<th>id</th>
<th>num</th>
</tr>
<?php
foreach ($this ->paginator as $key =>$value)
{
echo '<tr>
<td>'.$value->id.'</td>
<td>'.$value->num.'</td>
</tr>';
}
?>
</table>
</div>
</div>
<div class = "pagination">
<?php
echo $this->paginationControl($this->paginator,'Sliding','pagination.phtml' );
?>
</div>
<div class= "search-form">
<?php
echo $this->form;
echo $this->errorMessage;
?>
</div>
<div class="datagrid" id = "last">

<table>
<tr>
<th>id</th>
<th>num</th>
</tr>
<?php
for ($i=0 ; $i<$this->rowCount; ++$i)
{
print  '<tr><td>'. ($this->rowArray[$i]['id']).'</td>';
print  '<td>'. ($this->rowArray[$i]['num']).'</td>';
}?>
</table>
</div>

1

Решение

$('#first').html($('#last').html());

Но вы должны сделать это, когда документ загружен так в

$( document ).ready(function()
{
$('#first').html($('#last').html());
});
0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]