How to render QWaitIcon when use javascript event calls...

thread: 3 messages  |  last: a year ago  |  started: thursday, march 18, 2010, 2:28 am pdt


#1  |  apselico (Trujillo, PE) Peru
Thursday, March 18, 2010, 2:28 AM PDT

Hi everybody, i have a datagrid which shows some data updated by a process...
The process is called by pressing a button or ( periodically ) by a javascript event, when i click on the button the QWaitIcon is shown without problems,
but i dont know how to show the QWaitIcon when the event is called by javascript,
i try to make visible the control using
//$this->objDefaultWaitIcon->Display = true;
or
//QApplication::ExecuteJavaScript(sprintf('qc.getW(“%s”).style.cssText = “display:inline;”; ', $this->objDefaultWaitIcon->ControlId));
but i have no success...

here some code:

<?php
protected function btnProcesar_Click(){
    
//RUN A PROCESS
    
include("export.php");
    
    
$this->dtgProcess->Refresh();
                
    
//Re-ejecucion de metodo
    
if(!($this->IsProcessExecuted())){
        
$objLogFileProcessUltimo LogFileProcess::LoadUltimo();
        if(
$objLogFileProcessUltimo instanceof LogFileProcess){
            if(
$objLogFileProcessUltimo->Estado == EstadosProcesos::PARTECULMINADA){
                
$command sprintf('window.setTimeout(function() {qc.pA(\'%s\', \'%s\', \'QClickEvent\', \'%s\')}, 1000);'$this->FormId,$this->btnProcesar->ControlIdnull);
                
QApplication::ExecuteJavaScript$command );
                
//$this->objDefaultWaitIcon->Display    = true;
                //QApplication::ExecuteJavaScript(sprintf('qc.getW("%s").style.cssText = "display:inline;"; ', $this->strControlId));
                
return;
            }
        }
    }
    
    
$this->btnProcess->Display    true;
}
?>

any ideas?
Thanks.

#2  |  Ago Luberg (Tallinn) Estonia
Thursday, March 18, 2010, 6:20 AM PDT

for qc.pA call, the 5th parameter is the id of wait icon. In your case, it should probably be $this->objDefaultWaitIcon->ControlId.

#3  |  apselico (Trujillo, PE) Peru
Thursday, March 18, 2010, 8:01 AM PDT

You were right, thank you very much it works!!!



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.