Page 1 of 1

Field Alignment

Posted: 2014-05-09 12:36
by jweldy
Hi everyone, I just bought this great app 2 days ago and already have a very basic database setup. I'm completely new to php but have some database experience.
I was wondering if there is a way to align 2 fields onto one line in the application? I've tried the Alignment setup but doesn't change anything in detail view.
As a example I have a customer list were I have state field and zip field with zip field below state field in detail view. I'd like to have them side by side.

I know this is probably a stupid question but as always any help is really appreciated. BTW, this seems to one of the nicest forums I've ever been to, very positive and constructive!

Thanks,
Jay

Re: Field Alignment

Posted: 2014-05-09 22:31
by a.gneady
In the generated "templates" folder, find a file named "tablename_templateDV.html" (where tablename is the name of the concerned table), open it a in a text editor ... The 2 concerned fields would be represented with code similar to this:

Code: Select all

<div class="form-group">
	<label for="LastName" class="control-label col-lg-3">Last Name</label>
	<div class="col-lg-9">
		<input tabindex="1" maxlength="50" type="text" class="form-control" name="LastName" id="LastName" value="<%%VALUE(LastName)%%>">
	</div>
</div>

<div class="form-group">
	<label for="FirstName" class="control-label col-lg-3">First Name</label>
	<div class="col-lg-9">
		<input tabindex="1" maxlength="10" type="text" class="form-control" name="FirstName" id="FirstName" value="<%%VALUE(FirstName)%%>">
	</div>
</div>
The above code displays them vertically stacked, which is the default layout ... that is, each field on a separate line. To change the layout to be side-by-side, modify the code to something like this:

Code: Select all

<div class="form-group">
	<label for="LastName" class="control-label col-lg-3">Last Name</label>
	<div class="col-lg-3">
		<input tabindex="1" maxlength="50" type="text" class="form-control" name="LastName" id="LastName" value="<%%VALUE(LastName)%%>">
	</div>
	<label for="FirstName" class="control-label col-lg-3">First Name</label>
	<div class="col-lg-3">
		<input tabindex="1" maxlength="10" type="text" class="form-control" name="FirstName" id="FirstName" value="<%%VALUE(FirstName)%%>">
	</div>
</div>
For more information, you could refer to the "Grid system" and "Forms" sections in the Bootstrap reference at http://getbootstrap.com/css/

Re: Field Alignment

Posted: 2014-05-11 11:48
by jweldy
Thank you Sir, just seeing what lines and the code change taught me a lot right there!
I also appreciate the link you included, which is now a permanent bookmark.
This is a great program for learning this stuff and greatly appreciate your time with what I'm sure sounded a stupid question.

Highly looking forward to the learning curve and using AppGini.

Jay