Page 1 of 1
clone a page generated by appgini with a different name
Posted: 2017-07-15 07:13
by danielefeola
Hello everyone,
Can you clone a page generated by appgini with a different name?
Table_one_view.php = xxx_view.php
Table_one_dml.php = xxx_dml.php
Etc etc
The container table is table_one, but I must enter default values for 2 different operators, which put different arguments.
Is there any other method?
Thank you
Re: clone a page generated by appgini with a different name
Posted: 2017-07-25 14:59
by a.gneady
Yes, you could do that but will have to manually link to the cloned xxx_view.php page. You should also update the value of
in the cloned file.
Re: clone a page generated by appgini with a different name
Posted: 2017-07-26 08:24
by danielefeola
Thanks Ahmad!
Another question on the same subject.
I'm following the online course and doing tests.
If you want to set the default values with a jquery trigger, instead of cloning the pages, I managed to set the default values, but they do not appear in the lookup table view.
$j('#ID_01-container').on('change', function(){
if($j('#ID_01-container').val() == '125') {
$j('#ID_02').val('218');
}
})
ID_01 lookup 01
ID_02 lookup 02
The value of ID_02 is right [console: $j('#ID_02').val() = 218] but no screen is displayed but only if the record is not saved.
Re: clone a page generated by appgini with a different name
Posted: 2017-07-27 21:27
by a.gneady
Lookup drop-downs are created using a special JavaScript component named "Select2" ... The part
in your code above should be changed to:
Code: Select all
$j('#ID_01-container').select2('val')
Re: clone a page generated by appgini with a different name
Posted: 2017-07-28 08:53
by danielefeola
Hello Ahmad,
maybe I explained myself wrong.
I have 2 lookup. ID_01 and ID_02.
When selecting a certain 'xxx' value in the lookup ID_01,
I should automatically value a 'yyy' default value in lookup ID_02.
This script works.
Check and intercept the value '125' in lookup ID_01 and set the value '218' in lookup ID_02.
The problem is that the value associated with the '218' ID does not appear in the lookup.
If the record is saved it is displayed correctly.
If I open the corresponding record in modal, it is correct.
Where am I wrong?
Is there another system?
Thank you

- 02.png (20.79 KiB) Viewed 9842 times

- 03.png (26.75 KiB) Viewed 9842 times

- 04.png (19.72 KiB) Viewed 9842 times

- 05.png (26.03 KiB) Viewed 9842 times
Re: clone a page generated by appgini with a different name
Posted: 2017-07-29 15:02
by DevGiu
Because I'm not developing with AppGini I don't remember, but I will take a look into my code because I have a function for this. You have to change text too AFAIR
Re: clone a page generated by appgini with a different name
Posted: 2017-08-03 05:31
by danielefeola
Well DevGiu, I'm waiting for your function. thank you
Re: clone a page generated by appgini with a different name
Posted: 2017-08-03 12:53
by a.gneady
OK, to specify both the value and text of the drop-down:
Code: Select all
$j('#ID_02-container').select2('data', { id: 218, text: 'Default option text here'});
Re: clone a page generated by appgini with a different name
Posted: 2017-08-03 20:57
by danielefeola
thank you so much !
Re: clone a page generated by appgini with a different name
Posted: 2017-08-04 20:27
by danielefeola
FYI
TRIGGER BETWEEN DIFFERENT DROPDOWN LOOKUP
table3-dv.js
Code: Select all
$j('#nominative-container').on('click', function(e){
// console.log(e);
var ID = $j('#nominative').val();
if(ID == '{empty_value}'){
$j('#address').val('');
$j('#address-container').select2('data', { id: '', text: '' });
}else if(ID == '1'){
$j.ajax({
url: 'hooks/aiax-table2.php',
data: { ID: 1 },
success: function(data){
$j('#address').val(1);
$j('#address-container').select2('data', { id: 1, text: data });
}
});
}
$j('#address').val('');
$j('#address-container').select2('data', { id: '', text: '' });
});
aiax-table2.php
Code: Select all
<?php
$currDir = dirname(__FILE__) . '/..';
include("$currDir/defaultLang.php");
include("$currDir/language.php");
include("$currDir/lib.php");
$ID = intval($_REQUEST['ID']);
$address = sqlValue("select address from table2 where id='{$ID}'");
echo $address;
?>
https://www.udemy.com/customizing-appgi ... ode=TENOFF
Re: clone a page generated by appgini with a different name
Posted: 2017-08-09 12:23
by a.gneady
I understand it's working now, Daniele, right?
Re: clone a page generated by appgini with a different name
Posted: 2017-08-09 12:56
by danielefeola
Yes Ahmad