How do I paginate the page? I have a search form and a search button that passes through the date range. The first page is working successfully, though, when I click on the second page, it shows everything how do I get the date range in my endorsement?
Edit: below My ReportSearch.php (model)
$ dataProvider = new ActiveDataProvider (['curiosity' => $ Query, 'endorsement' = & gt; ['pageSize' => 5, // 'param' => array ('search' = & gt; 'true', 'from_dt' = & gt; stockmovement_summary_from_sales_date , 'To_dt' = & gt; $ stockmovement_summary_to_sales_date),],]); $ DataProvider- & gt; SetSort (['defaultOrder' = & gt; ['d_item.desc_e_tx' => SORT_ASC,], 'Properties' => ['d_item.desc_e_tx']]); $ Detector; }
Below is my controller:
$ searchModel = new ReportSearch (); $ DataProvider = $ searchModel- & gt; SearchStockMovementSummary ($ stockmovement_summary_from_sales_date, $ stockmovement_summary_to_sales_date); $ This- & gt; Return ('stockmovementreportsummary' ['search' => 'true', 'dataProvider' = & gt; $ dataProvider, 'from_dt' = & gt; $ stockmovement_summary_from_sales_date, 'to_dt' = & Gt; $ stockmovement_summary_to_sales_date, 'model' = & gt; $ search modell,]);
Below is my index.php
$ report = $ datasaver- & gt; GetModels (); $ I = 1; Echo "& lt; table class = 'table table-striped table-range' & gt;"; The current stock at arm & lt ;, is "l & lt; echo; tr gt; # & lt; / th & gt; & lt; th & gt; item & lt; / th & gt; ; & Lt; th & gt; Total Summary Experiment Volume & lt; / th & gt; & lt; Th & gt / th & gt; & lt; Th & gt; Measurement & gt; & lt; / TR & gt; "; Foreign Currency ($ Report $ as Report) {$ item_key = $ report ['report_item_key']; $ Item_model = Item :: Search () - & gt; Where (['item_key' = & gt; $ item_key]) - & gt; One (); $ Item_e_desc_tx = $ item_model- & gt; Desc_e_tx; $ Item_c_desc_tx = $ item_model- & gt; Desc_c_tx; $ Item_qty_no = $ item_model- & gt; Qty_no; $ Item_measurement_tx = $ item_model- & gt; Measurement; Echo "& lt; tr & gt;"; Echo "& lt; td & gt;" . $ I ++ "& lt; / td & gt;"; Echo "& lt; td & gt;" . HTML :: A ($ item_key, array ('stockmovementreportdetailbyitem', 'item_key' = & gt; $ item_key, 'search' = & gt; true ',' from_dt '= & gt; $ from_dt,' to_dt '= & Gt; $ to_dt)) "& lt; br & gt;" . $ Item_e_desc_tx "& lt; br & gt;" . $ Item_c_desc_tx "& Lt; / td>"; Echo "& lt; td & gt;" . $ Report ['total_summary_usage_qty'] "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Item_qty_no "& lt; / td & gt;"; Echo "& lt; td & gt;" . $ Item_measurement_tx "& lt; / td & gt;"; Echo "& lt; / tr & gt;"; } Resonates "& lt; / table & gt;"; Echo \ yii \ widgets \ LinkPager :: widget (['endorsing' => $ dataprider-> pagination on page,]); GridView should be used but I do not think it will help.
OK, because you actually use POST, you have to create your own paging function that takes you into the post. Or just use GET, you are not doing any operations for DB, you can safely use GET. It's better for everyone.
No comments:
Post a Comment