Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to hide cgridview filter with Yii?
    primarykey
    data
    text
    <p>Q : how to hide the column at CGridView?</p> <p>status : I followed the posts from yii forum to hide the column as <a href="http://www.yiiframework.com/forum/index.php/topic/13635-how-to-hide-a-column-in-cgridview/" rel="nofollow noreferrer">here</a> and <a href="http://www.yiiframework.com/forum/index.php?/topic/13589-hidden-values-in-cgridview/" rel="nofollow noreferrer">here</a>. but in my grid view the right column didn't hide. it is showing as a blank.</p> <p>This is my view code</p> <pre><code>&lt;?php $this-&gt;widget('zii.widgets.grid.CGridView', array( 'id'=&gt;'acc-recei-grid', 'dataProvider'=&gt;$model-&gt;search_arlist(), 'filter'=&gt;$model, 'columns'=&gt;array( array('name' =&gt; 'acc_category_id', 'value'=&gt;'(isset($data-&gt;acccategories-&gt;name)) ? CHtml::encode($data-&gt;acccategories-&gt;name) :""', 'filter'=&gt;CHtml::listData($acccategory, 'id', 'name'), ), //'customer_id', //'date', array('name' =&gt; 'job_id', 'value'=&gt;'(isset($data-&gt;jobs-&gt;name)) ? CHtml::encode($data-&gt;jobs-&gt;name) :""', //'filter'=&gt;CHtml::listData($job, 'id', 'name'), ), array( 'class'=&gt;'CButtonColumn', 'template'=&gt;'{select}', 'buttons'=&gt;array ( 'select' =&gt; array ( 'imageUrl'=&gt;Yii::app()-&gt;request-&gt;baseUrl.'/protected/assets/images/gridview/icon_select.gif', 'options'=&gt;array('style'=&gt;'width:10px; border:none'), 'click'=&gt;'function(){ var itemID = $(this).parents(\'tr\').find(\'.recei-id\').text(); $("#AccPaymentRecei_acc_recei_id").val(itemID); $("#accreceilist").dialog("close"); }', ), ), ), array( 'type'=&gt;'raw', 'value'=&gt;'$data-&gt;id', //'filter'=&gt;array('style'=&gt;'visible:none'), 'headerHtmlOptions'=&gt;array('style'=&gt;'width:0px; display:none; border:none; textdecoration:none'), 'htmlOptions'=&gt;array('style'=&gt;'display:none; border:none;', 'class'=&gt;'recei-id'), 'header'=&gt;false, 'filter'=&gt;false, ), ), )); ?&gt; </code></pre> <p>but the grid view show like this</p> <p><img src="https://i.stack.imgur.com/9yiMo.png" alt="enter image description here"></p> <p>====== update </p> <pre><code>&lt;div id="acc-recei-grid" class="grid-view"&gt; &lt;div class="summary"&gt;Displaying 1-1 of 1 result(s).&lt;/div&gt; &lt;table class="items"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th id="acc-recei-grid_c0"&gt;&lt;a href="/mmaig_ceo/ceo-control-system/accRecei/Accreceilist?AccRecei_sort=acc_category_id"&gt;Acc Category&lt;/a&gt;&lt;/th&gt;&lt;th id="acc-recei-grid_c1"&gt;&lt;a href="/mmaig_ceo/ceo-control-system/accRecei/Accreceilist?AccRecei_sort=job_id"&gt;Job&lt;/a&gt;&lt;/th&gt;&lt;th class="button-column" id="acc-recei-grid_c2"&gt;&amp;nbsp;&lt;/th&gt;&lt;th style="width:0px; display:none; border:none; textdecoration:none" id="acc-recei-grid_c3"&gt;&amp;nbsp;&lt;/th&gt;&lt;/tr&gt; &lt;tr class="filters"&gt; &lt;td&gt;&lt;select name="AccRecei[acc_category_id]"&gt; &lt;option value=""&gt;&lt;/option&gt; &lt;option value="1"&gt;asdfasdf&lt;/option&gt; &lt;/select&gt;&lt;/td&gt;&lt;td&gt;&lt;input name="AccRecei[job_id]" type="text" maxlength="11" /&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr class="odd"&gt;&lt;td&gt;asdfasdf&lt;/td&gt;&lt;td&gt;asdf&lt;/td&gt;&lt;td class="button-column"&gt;&lt;a style="width:10px; border:none" class="select" title="select" href="#"&gt;&lt;img src="/mmaig_ceo/ceo-control-system/protected/assets/images/gridview/icon_select.gif" alt="select" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td style="display:none; border:none;" class="recei-id"&gt;1&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;div class="keys" style="display:none" title="/mmaig_ceo/ceo-control-system/AccRecei/Accreceilist"&gt;&lt;span&gt;1&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload