why I make two field into one row but they are different size?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Sai chi
Posts: 19
Joined: 2017-08-26 15:29

why I make two field into one row but they are different size?

Post by Sai chi » 2017-10-29 12:15

I follow all steps from course "Organizing Long Forms into a horizontal layout"

https://gist.github.com/AppGiniCourse/d ... 9de3e4f51c

But the Field cannot be the same size, What is wrong?

the course said will be the same size. my code is

function Property_dv($selectedID, $memberInfo, &$html, &$args){
/* change the layout only if this is not the print preview */
if(isset($_REQUEST['dvprint_x'])) return;

ob_start(); ?>

<script>
$j(function(){
$j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');


})
</script>

<style>
@media (min-width: 768px){
.form-inline .form-group{
width: 48%;
margin-bottom: 0.75em;
vertical-align: top;
}
}
</style>

<?php
$new_layout = ob_get_contents();
ob_end_clean();

$html .= $new_layout;
Attachments
my interface@1.jpg
my [email protected] (85.42 KiB) Viewed 2850 times

User avatar
landinialejandro
AppGini Super Hero
AppGini Super Hero
Posts: 126
Joined: 2016-03-06 00:59
Location: Argentina
Contact:

Re: why I make two field into one row but they are different size?

Post by landinialejandro » 2017-10-29 15:29

hi, you need to add another class control like this

Code: Select all

           /* new code*/
                    .form-inline .form-control {
                    width: 90% !important;
		    }                   
		    /*end new code*/
your full code :

Code: Select all

if(isset($_REQUEST['dvprint_x'])) return;

                ob_start(); ?>

                <script>
                $j(function(){
                $j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');
                $j('fieldset.form-horizontal').removeClass('form-horizontal').addClass('form-inline');


                })
                </script>
                <style>
                @media (min-width: 768px){
                    
                    /* new code*/
                    .form-inline .form-control {
                    width: 90% !important;
}                   /*end new code*/

                    .form-inline .form-group{
                    width: 48%;
                    margin-bottom: 0.75em;
                    vertical-align: top;
                    }
                }
                </style>

                <?php
                $new_layout = ob_get_contents();
                ob_end_clean();

                $html .= $new_layout;
Alejandro.
AppGini 5.98 - Linux OpenSuse Tumblewweed.

Some of my posts that may interest you:
:arrow: Landini Admin Template: Template for Appgini like AdminLTE
:arrow: Profile image plugin: add and changue image user profile
:arrow: Field editor in table view: Configurable fast edit fields in TV
:idea: my personal page

Sai chi
Posts: 19
Joined: 2017-08-26 15:29

Re: why I make two field into one row but they are different size?

Post by Sai chi » 2017-11-04 14:48

Hi:

I just copy all of your code and post it, my system is no run at all?
I just copy all code from video and it runs in the video but not in my system, why?

Post Reply