Edit ApPHP data grid in tabs [Solved]

Discuss everything related to ApPHP Tabs. Any questions related to the ApPHP Tabs developing or using should be posted to this forum.

Moderators: ne_moj, zewa, Milton, vadimako, ne_moj, zewa, Milton, vadimako

Buzz Brown
Senior
Senior
Posts: 41
Joined: Apr 18th, '10, 09:47
Location: Auburn Hills, MI

Edit ApPHP data grid in tabs [Solved]

Postby Buzz Brown » Apr 8th, '11, 22:48

I have a PHP page with 5 tabs. Each tab displays a different ApPHP Data Grid. When I click the EDIT button on the data grid in the 5th tab the screen jumps to the 1st tab and displays the view mode for that data. How can I keep the focus on the 5th tab?
Last edited by Buzz Brown on Jul 16th, '15, 12:46, edited 1 time in total.

administrator
Site Admin
Site Admin
Posts: 5988
Joined: Jan 7th, '09, 23:18
Contact:

Re: Edit ApPHP data grid in tabs

Postby administrator » Apr 10th, '11, 11:06

Does it keeps selected Tab for 1sr, 2nd, 3rd and 4th datagrids?
How did you do this?

Buzz Brown
Senior
Senior
Posts: 41
Joined: Apr 18th, '10, 09:47
Location: Auburn Hills, MI

Re: Edit ApPHP data grid in tabs

Postby Buzz Brown » Apr 10th, '11, 12:44

I have only tried editing on the 5th tab. I did not want to spend too much time on this until I knew it would work. I will try editing one of the other tabs as well. The datagrid has been given a unique prefix name and $dgrid has been given a unique suffix.

Listed below is the PHP code I used to create the 5 tabs and call the appropriate grid. I am using ajax post back and remembering the passed parameters.

$revenues = $tabs->AddTab("Revenues","content/revenues.php?AnnualDataID=".$AnnualDataID."");
$expenses = $tabs->AddTab("Expenses","content/expenses.php?AnnualDataID=".$AnnualDataID."");
$indicator=$tabs->AddTab("Indicator Score","content/indicator.php?AnnualDataID=".$AnnualDataID."");
$compensation=$tabs->AddTab("Compensation","content/compensation.php?AnnualDataID=".$AnnualDataID."");
$debtequity=$tabs->AddTab("Debt & Equity","content/debtequity.php?AnnualDataID=".$AnnualDataID."");
$notes=$tabs->AddTab("Notes & Public Safety Sources","content/notes.php?AnnualDataID=".$AnnualDataID."");

Code from the 5th datagrid PHP file:
$http_get_vars = array("AnnualDataID","Type");
$dgridNotes->SetHttpGetVars($http_get_vars);
$postback_method = "ajax";
$dgridNotes->SetPostBackMethod($postback_method);

administrator
Site Admin
Site Admin
Posts: 5988
Joined: Jan 7th, '09, 23:18
Contact:

Re: Edit ApPHP data grid in tabs

Postby administrator » Apr 12th, '11, 17:56

We need to see it in work to understand what is the problem.
Can you please send us a a link to your page?
Also.. did you try to use POST method instead of AJAX for SetPostBackMethod()?

Buzz Brown
Senior
Senior
Posts: 41
Joined: Apr 18th, '10, 09:47
Location: Auburn Hills, MI

Re: Edit ApPHP data grid in tabs

Postby Buzz Brown » Apr 23rd, '11, 09:38

I tried Post but the focus still jumped to the first tab. I cannot share the link as this is a password-protected application. The problem seems to be chronic and easy to duplicate. I will try with some play data.

administrator
Site Admin
Site Admin
Posts: 5988
Joined: Jan 7th, '09, 23:18
Contact:

Re: Edit ApPHP data grid in tabs

Postby administrator » Apr 24th, '11, 08:55

You may send us a file, so we could test it on our server.

Buzz Brown
Senior
Senior
Posts: 41
Joined: Apr 18th, '10, 09:47
Location: Auburn Hills, MI

Re: Edit ApPHP data grid in tabs

Postby Buzz Brown » Jun 4th, '11, 17:04

I figured out the problem is with the default tab. If the default is tab #1 and you click edit on an ApPHP grid in tab #5 (or any other tab than #1), the screen refreshes and tab #1 is opened as the default. If I hard-code tab #5 as the default it works fine. Is there a way that the default tab can be set dynamically after each click of a tab? I tried putting a parameter in the query string and referencing that parameter but I get an error message that it is an undefined parameter.

administrator
Site Admin
Site Admin
Posts: 5988
Joined: Jan 7th, '09, 23:18
Contact:

Re: Edit ApPHP data grid in tabs

Postby administrator » Jun 5th, '11, 08:23


Buzz Brown
Senior
Senior
Posts: 41
Joined: Apr 18th, '10, 09:47
Location: Auburn Hills, MI

Re: Edit ApPHP data grid in tabs

Postby Buzz Brown » Jun 5th, '11, 12:08

No, that's hard-coded defaults. I need the default tab to be dynamic within the tabs itself. If I click on tab #5 the default should be tab #5. When I click on tab #2 the default should be tab #2. Reading a parameter from the query string doesn't seem to work because that gets read only once when the page is first opened. This parameter needs to be read each time the tabs are refreshed within the page.

administrator
Site Admin
Site Admin
Posts: 5988
Joined: Jan 7th, '09, 23:18
Contact:

Re: Edit ApPHP data grid in tabs

Postby administrator » Jun 6th, '11, 08:19

If I click on tab #5 the default should be tab #5.

Do you mean sub-tab?
Can you please explain this issue with some online example?


Return to “ApPHP Tabs”