Yii Framework Forum: Checkboxhtmloptions And Onchange Function Input Value - Yii Framework Forum

Jump to content

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

Checkboxhtmloptions And Onchange Function Input Value how use multiple value in onchange js function Rate Topic: -----

#1 User is offline   savariya 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-February 13
  • Location:india

Posted 16 April 2014 - 06:06 AM

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'complaint-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	
	'columns'=>array(
		array(
		'id'=>'Complaint_ID',
                'class'=>'CCheckBoxColumn',
		
			'checkBoxHtmlOptions' =>array('onchange'=>'hello1(this.value, second value)'),
			'value'=>'Complaint::model()->getStatusId1($data->Complaint_ID)',
                ),

how use $data->Complaint_ID in place of second value,

Please Help.

Thanks In advance

This post has been edited by Keith: 16 April 2014 - 06:15 AM
Reason for edit: Added code tags.

0

#2 User is offline   jkofsky 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 536
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 16 April 2014 - 02:27 PM

View Postsavariya, on 16 April 2014 - 06:06 AM, said:

$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'complaint-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	
	'columns'=>array(
		array(
		'id'=>'Complaint_ID',
                'class'=>'CCheckBoxColumn',
		
			'checkBoxHtmlOptions' =>array('onchange'=>'hello1(this.value, second value)'),
			'value'=>'Complaint::model()->getStatusId1($data->Complaint_ID)',
                ),

how use $data->Complaint_ID in place of second value,

Please Help.

Thanks In advance


Is 'checkBoxHtmlOptions' actually a thing? Should it be 'htmlOptions'?

p.s. Are you getting an error and/or what is it?
Do, or do not. There is no 'try.' Jedi Master Yoda
0

#3 User is offline   savariya 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-February 13
  • Location:india

Posted 18 April 2014 - 12:54 AM

View Postjkofsky, on 16 April 2014 - 02:27 PM, said:

Is 'checkBoxHtmlOptions' actually a thing? Should it be 'htmlOptions'?

p.s. Are you getting an error and/or what is it?


First of all thanks for reply 'jkofsky'.

so i all ready tried 'htmlOptions'.
at that time i'm getting this,

1)if i am use =
array('onchange'=>'hello1($data->Complaint_ID)'),

getting this error=>
SyntaxError: syntax error
hello1($data->Complaint_ID)

2)if i am use =
array('onchange'=>'hello1("$data->Complaint_ID")'),

i am not getting any error but, instead of value i get printed $data->Complaint_ID.

3) even 'this.value' is not working in htmlOptions, so i use checkBoxHtmlOptions.
0

#4 User is offline   jkofsky 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 536
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 22 April 2014 - 07:16 PM

View Postsavariya, on 18 April 2014 - 12:54 AM, said:

First of all thanks for reply 'jkofsky'.

so i all ready tried 'htmlOptions'.
at that time i'm getting this,

1)if i am use =
array('onchange'=>'hello1($data->Complaint_ID)'),

getting this error=>
SyntaxError: syntax error
hello1($data->Complaint_ID)

2)if i am use =
array('onchange'=>'hello1("$data->Complaint_ID")'),

i am not getting any error but, instead of value i get printed $data->Complaint_ID.

3) even 'this.value' is not working in htmlOptions, so i use checkBoxHtmlOptions.

Having not used the CheckBoxList, I didn't recognize checkBoxHtmlOptions.

As for 'onClick' I'm out of my depth...Sorry :(
Do, or do not. There is no 'try.' Jedi Master Yoda
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