Help with JTdivwindow

Help with JTdivwindow

Postby dbrazoli on Thu Nov 09, 2017 1:02 pm

Jon, I need your precious help again.
I created a JtDivWindow and added a JtPlatinumGrid.
I have an editbox where I type a product name piece for query.
I also have a 'Search' button. When I click the button it queries the database and populates the grid.
This actually happens, but DivWindow closes and I need to click the showmodal button again and the DivWindow is displayed with the grid filled out.
How do I prevent DivWindow from closing when I run only the query?

Grateful.
Daniel.
dbrazoli
 
Posts: 27
Joined: Thu Dec 19, 2013 6:33 pm

Re: Help with JTdivwindow, Yet

Postby dbrazoli on Fri Nov 10, 2017 5:27 pm

Jon, hello.
Still on the JtDivWindow, I have 2 questions:
I have a main screen with a grid.
1-I created a divwindow and set up an edit, grid and search button.
When it fills the grid, the divwindow closes automatically, and I need to click the button again, so the divwindow is displayed with the grid filled.
I ask: How to prevent the divwindow from closing when I fill in the grid?

In this case, the purpose is to select items in the divwindow and when I click the close button of the divwindow, I capture the selected items in the grid, close the divwindow and refresh the other grid in the main screen. But after closing the divwindow the grid is not updated automatically. If I click on the browser refresh button, then the grid refreshes.

I'm using Ajax in the main form (H5B) and ajaxRefreshAll = true in the grid.
Follow the code of the button close to divwindow.

function btfechadivJSClick ($ sender, $ params)
{
?>
// begin js
JTDivWindow1.Hide ();
// end
<? php
$ comps = array ('lstindiv');
echo ($ this-> btfechadiv-> ajaxCall ("montagradeindiv", $ params, $ comps));


}

I call the montagradeindiv function, where I capture the selected codes to fill the grid of the main screen.
From what I've seen, it's working, but not automatically. Just updating the browser.

I ask: How to run the routine automatically?

Grateful.
Daniel.
dbrazoli
 
Posts: 27
Joined: Thu Dec 19, 2013 6:33 pm

Re: Help with JTdivwindow

Postby jomitech on Sat Nov 11, 2017 12:00 am

Make sure you pass the name of the grid in the $comps array.
Jon
jomitech
Site Admin
 
Posts: 1902
Joined: Wed Oct 08, 2008 12:23 am

Re: Help with JTdivwindow

Postby dbrazoli on Sat Nov 11, 2017 8:24 am

Hello, Jon.
I did as you directed, informing the name of the grid in $comps. But it did not work. Just doing the refresh on the page.
In this page I have a pagecontrol with 3 tabs.
Also includes pagecontrol and active tab in $comps. Unfortunately it also did not work.
Follows the Ajax call;
function btfechadivJSClick ($ sender, $ params)
{
?>
// begin js
JTDivWindow1.Hide ();
// end
<? php
$comps =array('lstindiv','gradeproduto','controlepagina','tabprod');
echo ($ this-> btfechadiv-> ajaxCall ("montagradeindiv", $ params, $ comps));


}
Am I forgetting anything else?

Grateful.
dbrazoli
 
Posts: 27
Joined: Thu Dec 19, 2013 6:33 pm

Re: Help with JTdivwindow - almost solved

Postby dbrazoli on Sat Nov 11, 2017 6:21 pm

Hello, Jon.
I worked hard on this code today and finally I was able to solve 1 of the issues that I have had previously.
On the output of DivWindow, you are now updating the other components and queries automatically when closing. As I have a database query, I believe it is a bit too slow to finalize the routine, after closing the divwindow and completing the information update.

I still have the problem of divwindow closing automatically when I update the grid through a query to the database. I take the liberty of writing down the code of the query, by clicking the button.

function btconsultadivClick ($ sender, $ params)
{
global $ dmusi;


$ean = '';
$partenome = strtoupper ('%'. ltrim ($this->cepartenome-> Text). '%');

$sql = '';
$sql = "select distinct upper (t300_descricao) as descricao, t300_ean as ean from t300_medicamentos
where upper (t300_descricao) like ('{$ partenome}') order by descricao ";


$dmusi-> zproduto-> close ();
$dmusi-> zproduto-> sql-> clear;
$dmusi-> zproduto-> sql = $sql;
$dmusi-> zproduto-> open ();

n = 0;
$listaprod = array ('');
while (! $dmusi-> zproduto-> EOF)
{
$listprod [$ n] = array ('produto' => $dmusi-> zproduto-> descricao, 'ean' => $dmusi-> zproduto-> ean);
++ $ n;
$dmusi-> zproduto-> next ();

};

$this-> gridprod-> CellData = $listaprod;

}

Grateful.
Daniel.
dbrazoli
 
Posts: 27
Joined: Thu Dec 19, 2013 6:33 pm

Re: Help with JTdivwindow - I did a trick

Postby dbrazoli on Sun Nov 12, 2017 2:00 pm

Hello, Jon. I hope all is well with you.
On the question of Divwindow closing when I fill in the grid, I got a "trick". I repeated the showmodal command after filling the grid.
The screen is visible, but it clearly does the refresh with the screen blinking.
If you figure out how to avoid this refresh, I appreciate it.

Grateful.
dbrazoli
 
Posts: 27
Joined: Thu Dec 19, 2013 6:33 pm

Re: Help with JTdivwindow - Stubborn Divwindow

Postby dbrazoli on Mon Nov 13, 2017 4:16 pm

Hello, Jon.
First of all, I want to congratulate Jomitech for the excellent components he has developed.
I am very satisfied.

I need your wisdom. (laughs...)
After I told you that I had finished the process, even with a trick, I'm in a different situation.
Remembering:
1 - Insert a divwindow with a grid;
2 - fill in the grid from the database.
3 - select grid items
4 - I close the divwindow and feed another grid and write to the database
5 - I execute another operation with the information that is in the grid, that came from the divwindow.
6 - When clicking on the button indicated, the divwindow appears again, as if I had clicked the button that calls the divwindow. I already checked all the buttons and they are with the buttontype = BtNormal.

What do I need to do so that DivWindow is not displayed during this other process?

Grateful
Daniel.
dbrazoli
 
Posts: 27
Joined: Thu Dec 19, 2013 6:33 pm


Return to General

cron