CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Grid Label Length - (RESOLVED)

Print topic Send  topic

Author Message
SecureCloud


Posts: 51
Posted: 12/12/2012, 2:16 PM

I used the Grid Builder and created a Grid.

the problem is that, some labels are long, some are short.
is there a way to limit the length of the label on a Grid ??

it's wierd because the labels that are like 6 chars are 60
and ones that should be 60 are 6...

i looked all around...

some fields may be 500 chars

i tried
<td nowrap>{cust_status}</td>
and that works to keep them on 1 line
but like i said some fields are LONG...

how can i limit the length of the label ??

both of these dont work...
<td size="50">{cust_status}</td> 
<td width="50">{cust_status}</td> 

please help someone...
_________________
-------------------------------------------------------------------------------------------------
If this helped You, Please Donate to SecureCloud Here, ANY amount Accepted.
http://securecloud.biz/donate/
Thank You, Your help Keeps us Going.

View profile  Send private message
andrewi

Posts: 162
Posted: 12/12/2012, 2:40 PM

Two ways you could consider:

(A) limit the number of characters returned from the database. this means using LEFT() in your view/query/sql. It's discussed here - along with adding ... where text has been truncated: http://forums.codecharge.com/posts.php?post_id=18454.

(B) use styles to limit the width of the table cell:

Create a style like this in the head of the page, or in your stylesheet.
  
<style type="text/css">  
    p.limit  
    {      
        width: 200px;  
        overflow: hidden;  
    }  
</style>  

Then use the style in the cells you want to restrict:
  
<td>  
            <p class="limit">{cust_status}</p>  
</td>   
So in this example, the paragraph containing cust_status will never be wider than 200px, and any overflow will be hidden, rather than wrapping.
View profile  Send private message
SecureCloud


Posts: 51
Posted: 12/12/2012, 4:59 PM

Thanks andrew,

i think the style is the way i will do it
_________________
-------------------------------------------------------------------------------------------------
If this helped You, Please Donate to SecureCloud Here, ANY amount Accepted.
http://securecloud.biz/donate/
Thank You, Your help Keeps us Going.

View profile  Send private message
SecureCloud


Posts: 51
Posted: 12/12/2012, 5:17 PM

when i setup MySQL, i gave plenty of room for varchar().

is that what CCS goes by the char limit ?
is that how it decides how long they are ?

because i have a field that is 6 chars long, but on the grid its like 60...
and vice versa, i have a field that is like 60, but is wide enuff for like 6 chars..

how does CCS decide how long the LABEL is ?
and where does it store that ??


_________________
-------------------------------------------------------------------------------------------------
If this helped You, Please Donate to SecureCloud Here, ANY amount Accepted.
http://securecloud.biz/donate/
Thank You, Your help Keeps us Going.

View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 12/12/2012, 7:34 PM

http://php.net/manual/en/function.substr.php


_________________
Central Coast, NSW, Australia.

View profile  Send private message
SecureCloud


Posts: 51
Posted: 12/12/2012, 8:29 PM

maybe i wasnt clear, i dont want to remove data... i wanna display it all.

i just wanna be able to adjust the length of the cell, bigger or smaller
it can wrap, but I want to control the length of the cell in the grid

i have tried adjusting the width in <td> and <tr>

like, for ex.

phone - varchar(20)
phone_ext - varchar(5)

in the grid the phone label wraps to 2 lines and is only 10px wide for some reason
then the phone_ext label will be like 200px wide..

now do u understand what i'm saying...

the only fix that has worked is selecting the label, right clicking, editing <td> and checking nowrap..

then it displays on 1 line and fits in the cell

but what about smaller lines like the phone_ext, theres no way to make it smaller...


_________________
-------------------------------------------------------------------------------------------------
If this helped You, Please Donate to SecureCloud Here, ANY amount Accepted.
http://securecloud.biz/donate/
Thank You, Your help Keeps us Going.

View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 12/12/2012, 8:36 PM

Set table size, specify the td width of all but one cell....?
set th ?
_________________
Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.