Yii Framework Forum: The Multiple Feature Not Working In Select2 Ext. - Yii Framework Forum

Jump to content

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

The Multiple Feature Not Working In Select2 Ext. i added the select2 search in advenced search from...

#1 User is offline   Igor Savinkin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 30-July 13

  Posted 05 September 2013 - 03:43 AM

I've added the select2 search in advenced search from, it works yet not with 'multiple' htmlOptions.
$this->widget('bootstrap.widgets.TbGridView', 
    array(
	'id'=>'assortment-grid',
    // 'type'=>'striped bordered condensed',
    'itemsCssClass' => 'table-bordered items',
    'dataProvider'=>$model->search(),
    'filter' => $model,
    'template'=>"{items}\n{pager}",
	'htmlOptions'=>array('enctype' => 'multipart/form-data'),
    'columns'=>array(			
                array('name'=>'sku', 'header'=>'Артикул'),
                array('name'=>'agroup', 
						'header'=>'Марка', 
						'value' => '$data->Groupname',
						//'filter' => $groupFilter 
						),
				array('name'=>'subgroup', 
						'header'=>'Подгруппа', 
						//'value' => '$data->Groupname',
						//'filter' => $subgroupFilter
						),
                array('name'=>'title', 'header'=>'Наименование'),
                array('name'=>'measure_unit', 'header'=>'Ед. Измерения'),
...
                                ),
                        ),
                ),      
    ),
));

*_search.php* invoked thru 'Advanced Search' btn. where select2 is located:
<div class="wide form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
));	
echo '<table border="0" width="100%"><tr><td width="30%">';
			$GroupArray = CHtml::listData(AssortmentGroups::model()->findAll(), 'id', 'name');
				echo 'Auto make</br>';
				// Working with model SELECT2 
				  $this->widget('ext.select2.ESelect2',array(
				 'name' => 'Assortment[agroup]',
			          'model'=>$model,
				  'data'=>$GroupArray,
				  /* 'htmlOptions'=>array( 
						 'multiple'=>'multiple',
					   ),  */
				));  
				?>
		</td>
		<td valign="top" style='padding:0 0 0 15px'>
			<?php echo '  Subgroup</br>';
			$SubgroupArray = CHtml::listData(AssortmentSubgroups::model()->findAll(), 'name', 'name');
			$this->widget('ext.select2.ESelect2',array(
				 'name' => 'Assortment[subgroup]',
			     'model'=>$model,
				  'data'=>$SubgroupArray,
				  'htmlOptions'=>array( 
						 'multiple'=>'multiple',
					   ),  
				));
		</td>
		
		<td width="30%"></td>
	</tr>
</table>
<?php echo CHtml::submitButton('Выбрать', array('class' => 'btn btn-mini btn-info')); ?>
<?php $this->endWidget(); ?>
</div><!-- search-form -->

When i add
 'htmlOptions'=>array('multiple'=>'multiple', ),

as i've done in the second search field and press the 'Search' btn. the '500 error' window pops up. See the attached file.
What's wrong?

Attached File(s)

  • Attached File  temp2.png (24.5K)
    Number of downloads: 14

0

#2 User is offline   chandran 

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

Posted 19 May 2014 - 02:54 AM

Hi,
try to use multple equal to true
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

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