php - Yii CGridView Sort for array as dataProvider -


I have an array as my data provider (I have also set up a custom filter method) and it looks okay and Works fine:

Enter image details here

But now, for responsive purposes, I need to remove filters on small devices, which I have accomplished:

 , 'html_Options' = & gt; Array ('square' = & gt; 'hidden-sm hidden-x hidden -md'), 'headerHalmoption' = & gt; Array ('class' = & gt; 'hidden-sm hidden-x hidden-md'), 'filter hmlopation' = & gt;   

and add sorting buttons like:

"Https: / / /i.stack.imgur.com/qtrZw.png "alt =" Enter image details here ">

How do I add sort options with a custom sort image?

I can post the full grid-video code, but it's a bit long (hence the custom column)

UPDATE

How does my data provider last script look like this:

  if (isset ($ _REQUEST ['FiltersForm']) $ filtersForm- & gt; ; Filter = $ _REQUEST ['FiltersForm']; # Obtain raw data and filter the data provider Data = $ Filter- Firm-> Filters ($ Model-> Results ['Company']); $ Datapriver = New Serad Pro ( $ Filt Made data); #Rend $ - ('result', array ('filter' => gt; $ filterform, 'dataprider' = & gt; $ dataprider, 'model' = & gt; $ model));    

You can use.

Dataprovider Using Csort, Public Function Action Index () {$ sort = new CSort (); $ sort- & gt; attribute = array ('client' = & gt; array (' ASC '=>' Customer Custommaster_Name ',' No '= & gt; 'customer.customer_name desc',), 'school' = & gt; Array ('esk' = & gt; 'school.school_name', 'desc' = & gt; 'school.school_name desc',), 'submitted', 'requested_date',); $ DataProvider = newCactiveDataProvider ('printjob', array inner ('criteria' = & gt; array ('nickname' = & gt; 'pj', 'join' = & gt; 'customer.customer_id = pj.customer_id' School school = school = school = school_id = pj.ychool_id ',),' sort '= & gt; $ sort,' pagination '=> array (' pagesize '= & gt; self :: PAGE_SIZE,))) ; $ This- & gt; Render ('index', array ('dataProvider' => $ dataProvider));

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -