Grid-Add row count 0 for master/add

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
btrade
User
Posts: 357

Grid-Add row count 0 for master/add

Post 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.


mobhar
User
Posts: 11709

Post by mobhar »

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


btrade
User
Posts: 357

Post 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.


mobhar
User
Posts: 11709

Post 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?


btrade
User
Posts: 357

Post 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.


mobhar
User
Posts: 11709

Post 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.


btrade
User
Posts: 357

Post by btrade »

Where can I add this code?


mobhar
User
Posts: 11709

Post 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.


arbei
User
Posts: 9370

Post by arbei »

You may try and use Page_Load server event to set:

$this->GridAddRowCount = 0;


btrade
User
Posts: 357

Post by btrade »

Yes, it works very good.
think so much.


Post Reply