Hide list records since form hide/show dropdown element

viatechcenter

viatechcenter
Hi, I like to know how hide list records when only select one option in dropdown element with hide/show JS.
In the image, drop down hide/show JS form option is selected (red rectangle), but in the list, all options are show.
Could you please help me?
Thanks

Francisco
 

Attachments

  • form_hide_show_je.PNG
    form_hide_show_je.PNG
    65.8 KB · Views: 195
  • table_hide_record.PNG
    table_hide_record.PNG
    69.9 KB · Views: 193
There seems something totally wrong with your list CSS.
What is your list template? Try with default list template and a standard Joomla template.
 
My list template is DIV. I need DIV template because we print the list records in thin ticket. Could you please help me about this?

Thanks

Francisco.
 
We currently don't do anything in list view with regards to the JS hide / show events for form view.

You'd have to do some custom list template coding to achieve that.

-- hugh
 
Any idea in order to fix this? Please, I tried but I dont know how exactly works CSS with PHP in this case.

Thanks

Francisco.
 
There seems something totally wrong with your list CSS.
What is your list template? Try with default list template and a standard Joomla template.

I tried with defaul list template and standard Joomla template but it does not work. Could you please check my website?
www.cottonstyleperu.com/sistema
I am sending you one image about this.
Thanks

Francisco
 

Attachments

  • defaul_template2.PNG
    defaul_template2.PNG
    81.4 KB · Views: 166
You'll need to clone a custom template, and in default_row.php do something like this:

PHP:
<div id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
	<ul>
	<?php foreach ($this->headings as $heading => $label) {	
                if (($heading == 'yourtable___PrecioUnidad && $this->headings['yourtable___Precio'] != 'unidad') || ($heading == 'yourtable___PrecioMayor && $this->headings['yourtable___Precio'] !== 'mayor') || ($heading == 'yourtable__PrescioDescuente' && $this->headings['yourtable___Precio'] !== 'descuente')) {
                     continue;
                }
		$style = empty($this->cellClass[$heading]['style']) ? '' : 'style="'.$this->cellClass[$heading]['style'].'"';?>
		<li class="<?php echo $this->cellClass[$heading]['class']?>" <?php echo $style?>>
			<?php echo $label;?>:
			<?php echo @$this->_row->data->$heading;?>
		</li>
	<?php }?>
	</ul>
</div>

You'll have to change those element names and Precio values to suit your actual anmes and values.

-- hugh
 
I like to update to superior member level

Cheesegrits thanks a lot for your help. Your are great. What must I do in order go to superior member level?
Thanks again.

Francisco
 
I created DIV2 list template but appear this error:

Parse error: syntax error, unexpected T_STRING in /home/cottonst/public_html/sistema/components/com_fabrik/views/list/tmpl/div2/default_row.php on line 6

My Code Modifications:

<div id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
<ul>
<?php foreach ($this->headings as $heading => $label) {
if (($heading == 'fab_venta_5_repeat___precio_unidad && $this->headings['fab_venta_5_repeat___precio'] != 'Precio x Unidad') || ($heading == 'fab_venta_5_repeat___precio_mayor && $this->headings['fab_venta_5_repeat___precio'] !== 'Precio x Mayor') || ($heading == 'fab_venta_5_repeat___precio_descuento' && $this->headings['fab_venta_5_repeat___precio'] !== 'Precio con Descuento')) {
continue;
}
$style = empty($this->cellClass[$heading]['style']) ? '' : 'style="'.$this->cellClass[$heading]['style'].'"';?>
<li class="<?php echo $this->cellClass[$heading]['class']?>" <?php echo $style?>>
<?php echo $label;?>:
<?php echo @$this->_row->data->$heading;?>
</li>
<?php }?>
</ul>
</div>
 
Missing some quotes.

PHP:
if (
	($heading == 'fab_venta_5_repeat___precio_unidad' && $this->headings['fab_venta_5_repeat___precio'] != 'Precio x Unidad')
	||
	($heading == 'fab_venta_5_repeat___precio_mayor' && $this->headings['fab_venta_5_repeat___precio'] != 'Precio x Mayor')
	||
	($heading == 'fab_venta_5_repeat___precio_descuento' && $this->headings['fab_venta_5_repeat___precio'] != 'Precio con Descuento')
	) {
	continue;
}

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top