Yii Framework Forum: How To Create Two Column Of Checkbox List - Yii Framework Forum

Jump to content

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

How To Create Two Column Of Checkbox List Rate Topic: -----

#1 User is offline   karte 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 14-June 13
  • Location:thrissur

Posted 18 October 2013 - 07:12 AM

I've a code for checkbox list.
echo CHtml::activeCheckBoxList(PropertyFeaturesAmenities::model(), "amenities", CHtml::listData(Amenities::model()->findAll(), 'id', 'amenities'),array('class'=>'checkboxList'));


and it displays like this
Attached File  checkboxlist.png (53.62K)
Number of downloads: 41

and want to list it in three column like this..
Attached File  checkboxlist2.png (69.64K)
Number of downloads: 39
how to do this.
0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 488
  • Joined: 08-October 12
  • Location:Austria

Posted 18 October 2013 - 03:01 PM

View Postkarte, on 18 October 2013 - 07:12 AM, said:

I've a code for checkbox list.
echo CHtml::activeCheckBoxList(PropertyFeaturesAmenities::model(), "amenities", CHtml::listData(Amenities::model()->findAll(), 'id', 'amenities'),array('class'=>'checkboxList'));


and it displays like this
Attachment checkboxlist.png

and want to list it in three column like this..
Attachment checkboxlist2.png
how to do this.


Hi,

You can use clistview to display only checkbox and provide pagination for every 10 checkboxes.
Thats all..
This is one way of handling multiple checkbox options
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#3 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 488
  • Joined: 08-October 12
  • Location:Austria

Posted 18 October 2013 - 03:14 PM

Hi,

May be this will be helpful for you
http://stackoverflow...ee-parallel-div
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#4 User is offline   kayo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 15-March 13
  • Location:Curitiba, Brazil

Posted 18 October 2013 - 03:21 PM

try this

<div class="checkboxgroup">
  <?php echo $form->checkBoxList($model, 'attribute', CHtml::listData(), array('template'=>'<div><label class="checkbox">{input}{label}</label></div>')); ?>
</div>


css

.checkboxgroup {
	overflow:auto;
}

.checkboxgroup div {
	width: 130px;
	float:left;
}

1

#5 User is offline   karte 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 14-June 13
  • Location:thrissur

Posted 23 October 2013 - 11:16 AM

View Postkayo, on 18 October 2013 - 03:21 PM, said:

try this

<div class="checkboxgroup">
  <?php echo $form->checkBoxList($model, 'attribute', CHtml::listData(), array('template'=>'<div><label class="checkbox">{input}{label}</label></div>')); ?>
</div>


css

.checkboxgroup {
	overflow:auto;
}

.checkboxgroup div {
	width: 130px;
	float:left;
}



Thanks man.. I got it by doing some changes in your code.

<div class="checkboxgroup">
<?

echo CHtml::activeCheckBoxList($model, "attribute", CHtml::listData(),array('separator'=>' ','template'=>'<div>{input}{label}</div>'));
?>
</div>


CSS

.checkboxgroup {
    overflow:auto;
}

.checkboxgroup div {
	width: 230px;
	float:left;
}

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