Yii Framework Forum: Jtimepicker Tabular Input - Yii Framework Forum

Jump to content

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

Jtimepicker Tabular Input Rate Topic: -----

#1 User is offline   schowave 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 06-March 13

Posted 12 March 2013 - 08:04 AM

Hello,
i want to implement opening and closing hours for a shop. I want to use the extension http://www.yiiframew...n/jtimepicker/.
My Solution is already working with http://www.yiiframew...ion/timepicker.

Is there a Tabular Input for the JTimePicker Extension? I have the weekdays stored in a model array. With timepicker it is working, but I want to implement the design of jtimepicker. Let me give you the code:

<?php foreach ($openinghoursModelArray as $i=>$value):?>
	<div class="row">
		<div class="headline-small">
		<?php echo $weekdayArray[$i]->german?>
		</div>
	</div>
	<div class="row">
	
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'opening1', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'closing1', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
			
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'opening2', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
			
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'closing2', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
			
		</div>
	</div>
<?php 	endforeach?>



I can see the input fields, but the jtimepicker only appears in the first row (for Monday). Why does it not work for the other rows?
Thank you for your help!
David
0

#2 User is offline   schowave 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 06-March 13

Posted 12 March 2013 - 09:27 AM

View Postschowave, on 12 March 2013 - 08:04 AM, said:

Hello,
i want to implement opening and closing hours for a shop. I want to use the extension http://www.yiiframew...n/jtimepicker/.
My Solution is already working with http://www.yiiframew...ion/timepicker.

Is there a Tabular Input for the JTimePicker Extension? I have the weekdays stored in a model array. With timepicker it is working, but I want to implement the design of jtimepicker. Let me give you the code:

<?php foreach ($openinghoursModelArray as $i=>$value):?>
	<div class="row">
		<div class="headline-small">
		<?php echo $weekdayArray[$i]->german?>
		</div>
	</div>
	<div class="row">
	
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'opening1', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		</div>
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'closing1', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		</div>
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'opening2', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		</div>
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>'closing2', 'options'=>array('showPeriod'=>true,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
			
		</div>
	</div>
<?php 	endforeach?>



I can see the input fields, but the jtimepicker only appears in the first row (for Monday). Why does it not work for the other rows?
Thank you for your help!
David

I will give the answer to myself, just add something to the attributes:

	<?php foreach ($openinghoursModelArray as $i=>$value):?>
	<div class="row">
		<div class="headline-small">
		<?php echo $weekdayArray[$i]->german?>
		</div>
	</div>
	<div class="row">
	
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>"[$i]opening1", 'options'=>array('showPeriod'=>false,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		</div>
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>"[$i]closing1", 'options'=>array('showPeriod'=>false,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		</div>
		<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>"[$i]opening2",'options'=>array('showPeriod'=>false,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
				</div>

<div class="cell">
			<?php $this->widget('application.extensions.jui_timepicker.JTimePicker', array('model'=>$value, 'attribute'=>"[$i]closing2",'options'=>array('showPeriod'=>false,),'htmlOptions'=>array('size'=>8,'maxlength'=>8 ), ));?>
		</div>
	</div>
<?php 	endforeach?>

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