Yii Framework Forum: Dropdown - Yii Framework Forum

Jump to content

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

Dropdown Rate Topic: -----

#1 User is offline   vishnuvarthan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 22-February 13
  • Location:India

Posted 19 March 2013 - 12:24 PM

<?php 
echo CHtml::DropDownList('HiflashOrder[project_id]','',CHtml::listData(HiflashProjects::model()->findAll(), 'id', 'project_name'), array('empty'=>'Select Projects','style'=>'width:150px;'), array(
                   'onClick'=>"$.ajax{(
                         url:'" . Yii::app()->createUrl("HiflashOrder/ProjectFilter") ."',
                         type: 'POST',
                         success: 'function(data) { 
                                 $.fn.yiiGridView.update('order-grid', 
                                  {
                                      type:'GET', 
                                      url:'".Yii::app()->createUrl('hiflashOrder/admin')."', 
                                      data: $('#search_form').serialize()
                                  }); 
                                  }'
                               )};"
                       )); ?>



So the thing is what i have done is right or wrong? If so y its not showing the specified details alone?

Attached File(s)


0

#2 User is offline   Amy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 04-February 13

Posted 19 March 2013 - 02:59 PM

CHtml::DropDownList takes 4 parameters but you have 5. Looks like you got the last array in twice.

Does this work?

<?php 
echo CHtml::DropDownList(
	'HiflashOrder[project_id]' 
	,'' 
	,CHtml::listData(HiflashProjects::model()->findAll(), 'id', 'project_name'),
	array(
		'empty'=>'Select Projects',
		'style'=>'width:150px;',
                'onClick'=>"$.ajax{(
                        url:'" . Yii::app()->createUrl("HiflashOrder/ProjectFilter") ."',
                         type: 'POST',
                         success: 'function(data) { 
                                 $.fn.yiiGridView.update('order-grid', 
                                  {
                                      type:'GET', 
                                      url:'".Yii::app()->createUrl('hiflashOrder/admin')."', 
                                      data: $('#search_form').serialize()
                                  }); 
                                  }'
                               )};"
                       ));  ?>

0

#3 User is offline   vishnuvarthan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 22-February 13
  • Location:India

Posted 22 March 2013 - 12:07 PM

View PostAmy, on 19 March 2013 - 02:59 PM, said:

CHtml::DropDownList takes 4 parameters but you have 5. Looks like you got the last array in twice.

Does this work?

<?php 
echo CHtml::DropDownList(
	'HiflashOrder[project_id]' 
	,'' 
	,CHtml::listData(HiflashProjects::model()->findAll(), 'id', 'project_name'),
	array(
		'empty'=>'Select Projects',
		'style'=>'width:150px;',
                'onClick'=>"$.ajax{(
                        url:'" . Yii::app()->createUrl("HiflashOrder/ProjectFilter") ."',
                         type: 'POST',
                         success: 'function(data) { 
                                 $.fn.yiiGridView.update('order-grid', 
                                  {
                                      type:'GET', 
                                      url:'".Yii::app()->createUrl('hiflashOrder/admin')."', 
                                      data: $('#search_form').serialize()
                                  }); 
                                  }'
                               )};"
                       ));  ?>


see uh that code what i posted is wrong i asked suggestions to correct it. now i corrected it. so u want any help?
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