Page 1 of 1

Class names for images and grids

Posted: Tue May 22, 2012 5:06 pm
by Chris2656882

How can I add a class name to a grid or image inside a list?

It is not an option in the properties tab. If I attempt to add it under 'More Properties', it says that the word is reserved/restricted.


Class names for images and grids

Posted: Tue May 22, 2012 5:15 pm
by maxkatz

We will add 'class' property to both components. For now, you can select them and add style via jQuery.


Class names for images and grids

Posted: Tue May 22, 2012 5:39 pm
by Chris2656882

That doesn't seem to work when the grid is in a list.

For example, in the services output, I entered:

if(value.length == 0){
element.hide(); //hides the image
$('input[dsid="grid_cell_image"]').attr('style', 'display:none;');//doesnt hide cell
$('input[dsid="grid_cell_image"]').hide(); //doesnt hide cell
}

This hid the image (only because images have a visibility attribute in the services output), but not the grid cell (which does not).

I think the JQuery does not work because within a list, there are multiple elements with the same dsid. That's why I needed to modify the class.


Class names for images and grids

Posted: Tue May 22, 2012 5:47 pm
by Chris2656882

That doesn't seem to work when the grid is in a list.

For example, in the services output, I entered:

if(value.length == 0){
element.hide(); //hides the image
$('input[dsid="grid_cell_image"]').attr('style', 'display:none;');//doesnt hide cell
$('input[dsid="grid_cell_image"]').hide(); //doesnt hide cell
$('input[name="grid_cell_image"]').attr('style', 'display:none;');//doesnt hide cell
$('input[name="grid_cell_image"]').hide(); //doesnt hide cell
}

This hid the image (only because images have a visibility attribute in the services output), but not the grid cell (which does not).

I think the JQuery does not work because within a list, there are multiple elements with the same dsid. That's why I needed to modify the class.

I also noticed that even though it hid the image, the area (length x width) that the image placeholder consumed still exists. There is just an empty area in its place instead of everything getting resized to take its place.


Class names for images and grids

Posted: Tue May 22, 2012 5:59 pm
by maxkatz

You probably just need to hide the parent (or even higher), not the image.