Page 1 of 1

Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 12:21 am
by btrade

Hello,

how can I make Grid-Add row count 0 for master/add?
I maked this parameter = 0, but I have 6 rows for default.


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 8:14 am
by mobhar

How did you make the param you mentioned? You may post your code or your setting for more discussion.


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 12:23 pm
by btrade

I have created an master/add. I used only the standard settings in the phpmaker program. I didn't write additional code. I have a master table and 2 additional tables. In one of the tables, I need a person to add a grid for a record there himself. Otherwise, by default, I add data that is not needed.


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 12:29 pm
by mobhar

btrade wrote:

I used only the standard settings in the phpmaker program.

Which setting? From which menu in PHPMaker project? Could you explain it in more detail?


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 12:53 pm
by btrade

Tools > Advanced settings > Grid-Add row count > 0

for master/add
But I have five grid records when I make it new records.
I need 0 grid record for one table.


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 1:06 pm
by mobhar

Please note that from the logic defined in PHPMaker template, if the Grid-Add row count setting is set to 0 or any value that less than 0, the default value will automatically set to 5.

    // Grid add row count
    global.gridAddRowCount = PROJ.GridAddRowCount;
    if (!gridAddRowCount || gridAddRowCount <= 0)
        gridAddRowCount = 5;

So for your case, it is recommended to enter 1 instead of 0 to that setting above.


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 1:31 pm
by btrade

Where can I add this code?


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 1:41 pm
by mobhar

As mentioned before, the code is located inside the PHPMaker Template.

You may check it out from C:\Users\{user}\AppData\Roaming\phpmaker2023\node_modules\@phpmaker\php2023\shared\config-table.php file.

It is recommended to create your own Extension if you want to customize the code in PHPMaker Template side.


Re: Grid-Add row count 0 for master/add

Posted: Thu Mar 23, 2023 2:52 pm
by arbei

You may try and use Page_Load server event to set:

$this->GridAddRowCount = 0;


Re: Grid-Add row count 0 for master/add

Posted: Tue Mar 28, 2023 1:04 pm
by btrade

Yes, it works very good.
think so much.