clone a page generated by appgini with a different name

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

clone a page generated by appgini with a different name

Post by danielefeola » 2017-07-15 07:13

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

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: clone a page generated by appgini with a different name

Post by a.gneady » 2017-07-25 14:59

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

Code: Select all

$x->ScriptFileName
in the cloned file.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

Re: clone a page generated by appgini with a different name

Post by danielefeola » 2017-07-26 08:24

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.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: clone a page generated by appgini with a different name

Post by a.gneady » 2017-07-27 21:27

Lookup drop-downs are created using a special JavaScript component named "Select2" ... The part

Code: Select all

$j('#ID_01-container').val()
in your code above should be changed to:

Code: Select all

$j('#ID_01-container').select2('val')
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

Re: clone a page generated by appgini with a different name

Post by danielefeola » 2017-07-28 08:53

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
02.png (20.79 KiB) Viewed 8337 times
03.png
03.png (26.75 KiB) Viewed 8337 times
04.png
04.png (19.72 KiB) Viewed 8337 times
05.png
05.png (26.03 KiB) Viewed 8337 times
Attachments
select2.zip
(2.24 KiB) Downloaded 176 times

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: clone a page generated by appgini with a different name

Post by DevGiu » 2017-07-29 15:02

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
/Giuseppe
Professional Outsourcing Services

danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

Re: clone a page generated by appgini with a different name

Post by danielefeola » 2017-08-03 05:31

Well DevGiu, I'm waiting for your function. thank you

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: clone a page generated by appgini with a different name

Post by a.gneady » 2017-08-03 12:53

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'});
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

Re: clone a page generated by appgini with a different name

Post by danielefeola » 2017-08-03 20:57

thank you so much !

danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

Re: clone a page generated by appgini with a different name

Post by danielefeola » 2017-08-04 20:27

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
Attachments
JS-PHP.7z
(611 Bytes) Downloaded 180 times

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: clone a page generated by appgini with a different name

Post by a.gneady » 2017-08-09 12:23

I understand it's working now, Daniele, right?
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

danielefeola
Veteran Member
Posts: 31
Joined: 2013-04-19 13:36

Re: clone a page generated by appgini with a different name

Post by danielefeola » 2017-08-09 12:56

Yes Ahmad

Post Reply