Answer the question
In order to leave comments, you need to log in
Why does dataProvider break in YII2?
Good afternoon.
I don't understand the reason. Googled a lot, honestly.
There is this code:
$className = $this->className;
$query = $className::find();
$query->andWhere([
$this->attribute=>$this->model->id
]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 2,
],
'sort' => [
'defaultOrder' => [
'id' => SORT_DESC,
'name' => SORT_ASC,
]
],
]);
echo $dataProvider->getTotalCount(). '<br/>'; // 3
echo ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_list_item',
'options'=> [
'id'=>'comments-list',
],
'itemOptions' => [
'class' => 'comments-item'
],
]);
Answer the question
In order to leave comments, you need to log in
Free Spire.PDF for .NET
You probably have a paid version. Free prints fine.
Free is limited to 10 page pdf.
Native pdf printing, as far as I understand, depends on the printer. We have kyocera and hp eat pdf without any problems, though we send it with cups, and not from the user's machine (via a web service).
Thanks for the responses, I found out that the error is in the part:
'defaultOrder' => [
'id' => SORT_DESC,
// 'name' => SORT_ASC,
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question