Changing Column Width

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
Ledbelly2142
Posts: 19
Joined: 2013-03-18 15:18

Changing Column Width

Post by Ledbelly2142 » 2013-03-24 22:55

I would like to change the column width to one of my columns, it has a description of a product--so the narrow column ends up being very long.

The xxxx_templateTV.hml

The column I want to change is:
<td id="Product-ProductDesc-<%%VALUE(id)%%>" valign="top" class="Product-ProductDesc TableBody"><%%SELECT%%><%%VALUE(ProductDesc)%%><%%ENDSELECT%%></td>

I tried to use the WIDTH="600" (in pixels) but it has no effect... (see below)

<td WIDTH="600" id="Product-ProductDesc-<%%VALUE(id)%%>" valign="top" class="Product-ProductDesc TableBody"><%%SELECT%%><%%VALUE(ProductDesc)%%><%%ENDSELECT%%></td>

I read that in the datalist.php file, the If the ShowTableHeader property is set to 1, the ColWidth property is overridden by the width values specified in the table view template file (templates/tablename_templateTV.html).

I am not sure how to set the ShowTableHeader value to 1.
I tried to set the vale in the datalist.php file:
$ShowTableHeader, 1
and
$ShowTableHeader = 1,

Neither worked. I am pretty sure the 1 or 0 value has to do with showing the column header or not. Which makes me think my WIDTH="600" is incorrect.

Any help is appreciated
Thanks

Johnk
AppGini Super Hero
AppGini Super Hero
Posts: 68
Joined: 2013-01-09 03:47
Location: Cairns, Australia

Re: Changing Column Width

Post by Johnk » 2013-03-25 05:23

Hi Greg,

As I said earlier I did all my changes in xxx_templateTV.html and didn't strike any problems. What I did do was break my long membership form into separate tables to make things easier to handle. Here's the code for my Membership interests which is three columns wide.

The first column simply says interests
he second has a dropdown with our main activities listed. The member has multiple choices.
The Third is a text box where "strange" interests can be added.

As you can see, I was able to control the various cell widths okay. I'm in the middle of moving house so I don't have much time. I'll try to help if I can.

John

Code: Select all

<! ------------- AREARS OF INTEREST TABLE ----------------- !>
<table width = "950" border="0" cellpadding="4" cellspacing="4" id="dvForm">
	<tr>

		<! ------------- Interests (Left Column) ----------------- !>
	
		<td width="149" height="126" valign=middle class=TableHeader>
			<div align="center">Interests<br/></div>
            <div class=TableHeader style="text-align:right;"></div>
		</td>
		
<! ------------- Areas of Interest Drop Down ----------------- !>

        <td width="223" valign="top" class="FormBody"><span>Areas of Interest:</span><br />
            &nbsp;&nbsp;&nbsp;<%%COMBO(interests1)%%> <br />
		</td>
		
<! ------------- Other Interests Text Box ----------------- !>

        <td width="540" valign="top" class="FormBody">Other Interests:<br/>
            &nbsp;&nbsp;&nbsp;&nbsp;<textarea tabindex="1" class="TextBox" name="textarea" 
			id="textarea" cols="65" rows="5"><%%VALUE(Interests2)%%>
			</textarea>
        </td>
    </tr>
</table>

Ledbelly2142
Posts: 19
Joined: 2013-03-18 15:18

Re: Changing Column Width

Post by Ledbelly2142 » 2013-04-09 22:11

John,
One of the things I notice is that you html is much simpler than mine. for example you have straight forward table <td tags, below

<td width="149" height="126" valign=middle class=TableHeader>
<div align="center">Interests<br/></div>
<div class=TableHeader style="text-align:right;"></div>

Mine have VALUE(id)'s and class identifiers. You seem to have ridden yourself of the VALUE(id)s, replacing them with descriptive text, in your expample above >Interest<

<td id="EMSProduct-ProductDesc-<%%VALUE(id)%%>" valign="top" class="EMSProduct-ProductDesc TableBody"><%%SELECT%%><%%VALUE(ProductDesc)%%><%%ENDSELECT%%></td>

Adding width="640" and height'"200" in the <td tag does nothing for me... It may also be that because I have 15 columns, I am maxed out on width.

does the id="xxxx<%%VALUE(id)%%> cause the problem or is the column governed by the class definition?

-Greg

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Changing Column Width

Post by peebee » 2013-04-10 05:26

Hi Greg,

You'll find you can change ShowTableHeader value (and many other Table View options for that matter) by editing the generated xxx_view.php file

In xxx_view.php find:
$x->ShowTableHeader = 0;
and change the 0 value to 1

You can also edit all of these Table View options directly from within the xxx_view.php file
$x->AllowSelection = 1;
$x->HideTableView = ($perm[2]==0 ? 1 : 0);
$x->AllowDelete = $perm[4];
$x->AllowInsert = $perm[1];
$x->AllowUpdate = $perm[3];
$x->SeparateDV = 1;
$x->AllowDeleteOfParents = 0;
$x->AllowFilters = 1;
$x->AllowSavingFilters = 1;
$x->AllowSorting = 1;
$x->AllowNavigation = 1;
$x->AllowPrinting = 1;
$x->AllowPrintingMultiSelection = 1;
$x->AllowCSV = 1;
$x->RecordsPerPage = 50;
$x->QuickSearch = 3;
$x->TablePaginationAlignment = 0;
$x->QuickSearchText = $Translation["quick search"];
$x->ScriptFileName = "xxx_view.php";
$x->RedirectAfterInsert = "xxx_view.php";
$x->TableTitle = "XXX Detail";
$x->TableIcon = "resources/table_icons/application_form_magnify.png";
$x->PrimaryKey = "`xxx`.`xxx`";
$x->DefaultSortField = '1';
$x->DefaultSortDirection = 'desc';

Hope that helps a little.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Changing Column Width

Post by peebee » 2013-04-10 05:58

A bit more to add to that last post....

To edit column width in the table View the easy way:
Open the generated xxx_view.php
Find:
$x->ColWidth = array();
and change the values within the array. The numbers in the array represent width in pixels

Example from a generated file:
$x->ColWidth = array(120, 60, 200, 50, 25, 25, 90, 30, 20, 50, 50, 50, 50, 40, 40, 40);
Column number 3 will display 200px in width. To make it 300px wide, just change the 200 to 300. Done.

Same goes for Column captions if they don't fit in the confines of the column width - just edit directly in xxx_view.php
$x->ColCaption = array("Column 1", "Next Column", "This is Third Column", "And So On", "Etc, Etc, Etc");

Alternatively, just edit the original "Column Width (pixels)" and "Caption" values in the desired fields of your Appgini project and regenerate a fresh set of files. That way, changes are permanent.

PS: The html in your posts relates to the Table view tables. It is correct - don't change it.
The html table example in John's post looks to be from a detail view. They will be/are different.

Ledbelly2142
Posts: 19
Joined: 2013-03-18 15:18

Re: Changing Column Width

Post by Ledbelly2142 » 2013-04-11 00:54

I must be doing something simple wrong... I have tried to modify the xxx_view.php file as recommended above. It did not change the column settings.
I also tried changing the column width in the AppGini application, then generated the PHP code and replaced it all on my server. The things I changed, such as allow saving data to CSV files (unchecked the box) worked. But changing the column widths in the table field properties did not work, e.g. changing "Column Width (Pixels) from 150 to 300 did not have an effect. I verified that the php code produced by AppGini in fact shows the xxx_view.php file to contain the correct "300" pixel column width.
I refreshed my browser several times (even used a different browser), signed out and back in, but nothing is changing the column widths.
Its truly strange. I am overwriting all the files on my server... what else can I try?

I am afraid to delete all the dir contents and then upload instead of replace. I have spent so many hours with data entry, and I don't want to lose the connection to the MySQL db.

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Changing Column Width

Post by peebee » 2013-04-11 02:04

So, if you download the existing problemtable_view.php from the server now, it is showing the new desired column widths for the table concerned in
$x->ColWidth = array();

If so, I have no idea why it isn't working? That is definitely where the column widths in Table view are taken from. I gather from your posts that you are trying to widen the column widths? Try editing one of the column widths to say "600" and see what happens to your table?

If you edit the wording in the Column Caption array in problemtable_view.php and then replace that file on the server, does you see the changes to the column headers?
$x->ColCaption = array("Change this text", "or this text", "and this", "And So On", "Etc, Etc, Etc");

Failing that, sorry but I've run out of ideas...

Ledbelly2142
Posts: 19
Joined: 2013-03-18 15:18

Re: Changing Column Width

Post by Ledbelly2142 » 2013-04-11 15:29

I have downloaded the problemtable_view.php from the server, it shows the correct "changed" table width. The column width is still not changing. I tried changing the column width to 600, to no avail.
I can change the column captions in the problemtable-view.php, so the php files appear to be changing as intended.
I also added another table, but it is not showing up on the home screen.

It seems like a systemic issue, like some php version compatibility bug. The global PHP version on all my web servers is 5.2... Should I upgrade to 5.4? I don't think this should matter, but you never know. I do have another PHP "app" that has known issues with 5.4 that will take a chunk of time to sort out, so I can upgrade the php version if it is a worthy attempt.

Ledbelly2142
Posts: 19
Joined: 2013-03-18 15:18

Re: Changing Column Width

Post by Ledbelly2142 » 2013-04-11 18:03

I figured out why the new table was not showing up, it is an admin permission setting. Still having the column width issue, maybe a permissions issue as well?

Post Reply