Yii Framework Forum: Why Clistview Dataprovider Fails To Manage The Data Received From Sphinx? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Why Clistview Dataprovider Fails To Manage The Data Received From Sphinx? Rate Topic: ***** 1 Votes

#1 User is offline   flaviuspogacian 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 02-March 12
  • Location:Targu Mures - Romania

Posted 01 February 2013 - 04:15 AM

I use `Sphinx` to generate a list of needed `ID`'s. On this list of `ID`'s I apply `filters` using the `Sphinx` language and then I create and return a new CActiveDataProvider using the `Search` Model method;

$dataProvider = new CActiveDataProvider('model', array(
'criteria' => $criteria,
'pagination' => array(
'pageSize' => $this->pageSize,
'currentPage' => $this->cp_page - 1,
),
));

In the view, now, I have:

<div class="search_result searchconright">
<?php

$custom_pager_left = '
<div class="pagetxt">

<ul class="searchPager">
<li><span>View</span></li>
<li class="page"><a href="" class="page_search_limit">All</a></li>
<li class="page"><a href="" class="page_search_limit page_search_limit_active">3</a></li>
<li class="page"><a href="" class="page_search_limit page_search_limit_active">5</a></li>
<li class="page"><a href="" class="page_search_limit page_search_limit_active">24</a></li>
<li class="page"><a href="" class="page_search_limit">48</a></li>
</ul>

</div>
';

$this->widget('zii.widgets.CListView', array(
'ajaxUrl' => Yii::app()->createAbsoluteUrl('/employer/search'),
'id'=>'listViewSearch',
'dataProvider' => $model->search(),
'template' => "{summary}\n{sorter}\n{items}\n<div style='float:left;width=700px;'>$custom_pager_left<div class='pagetxt'>{pager}</div></div>",
'itemView' => '_index_post',
'enablePagination' => true,
'pager' => array(
'cssFile' => Yii::app()->baseUrl . '/css/clistview.css',
'header' => false,
'firstPageLabel' => 'First',
'prevPageLabel' => 'Previous',
'nextPageLabel' => 'Next',
'lastPageLabel' => 'Last',
),
'summaryText' => '',
'sortableAttributes' => array(
),
));
?>
</div>

But this fails to work correctly, because if i click next, and the list end's, somehow, the ajax code does not reinitialize the url that is being send, it keeps on to concat with the old url until the url gets so big that the app crashes.

Shouldn't CListView verify if the data received exists? Sphinx could give a ID of a registration, that is no more there or inactive;

What's happening and how can i prevent this?

I found this article, but it does not work for me.

yii framework clistview and ajax
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users