Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7457825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:22:19+00:00 2026-05-29T13:22:19+00:00

I want to control a grid with dates on two DatePickers, I’m reloading the

  • 0

I want to control a grid with dates on two DatePickers,
I’m reloading the whole page, although it may be better to reload the grid only.
Anyway, I can’t get the value of the datepicker in order to use it in the array in the reload, how should I do that? I have this:

class page_caja extends Page {
function init(){
    parent::init();

    if(!$_GET['fInicial']){
        $fInicial=date('d/m/Y');
    }else{
        $fInicial=$_GET['fInicial'];
    }
    if(!$_GET['fFinal']){
        $fFinal=date('d/m/Y');    
    }else{
        $fFinal=$_GET['fFinal'];
    }
    $f=$this->add('Form');

    $inicial=$f->addField('DatePicker','fInicial','Fecha Incial')->set($fInicial);
    $final=$f->addField('DatePicker','fFinal','Fecha Final')->set($fFinal);

    //Tabla de Pagos Pendientes
    $this->add('H3')->set('Movimientos');
    $g=$this->add('MVCGrid');
    $g->setModel('Caja');                
    $g->removeColumn('programaPago');
    $g->addColumn('date','created_dts','Fecha');
    $g->dq->where("DATE(created_dts)>=",$inicial->get());
    $g->dq->where("DATE(created_dts)<=",$final->get());
    $g->addTotals();


    $inicial->js('change',$this->js()->reload(array('fInicial'=>$inicial->js()->value(),'fFinal'=>$final->js()->value())));
    $final->js('change',$this->js()->reload(array('fInicial'=>$inicial->js()->value(),'fFinal'=>$final->js()->value())));


}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:22:19+00:00Added an answer on May 29, 2026 at 1:22 pm

    Your approach is quite good, I don’t see anything wrong with it, although I would write it like this. My method uses filter submit and takes one extra reload, but it works quite smooth and simple to understand:

    $filter = $page->add('Form');
    $grid  = $page->add('Grid')->setModel('Caja');
    
    $filter->addField('date','d1')->js('change',$filter->js()->submit());
    $filter->addField('date','d2')->js('change',$filter->js()->submit());
    
    if($filter->isSubmited()){z
        $this->memorize('d1',$filter->get('d1'));
        $this->memorize('d2',$filter->get('d2'));
        $grid->js()->reload()->execute();
    }
    
    $d1=$this->recall('d1',null);
    if($d1)$grid->dq->where('date(created_dts)>=',$d1);
    
    $d1=$this->recall('d2',null);
    if($d2)$grid->dq->where('date(created_dts)<=',$d2);
    

    You can also incorporate fields into the reload() but then you should be reading $d1 and $d2 from $_GET variable.

    If you can’t get value from a field, try simpler ways:

    $form->addField('test')->js('change')
        ->univ()->log(
             $form->getElement('test')->js()->val()
        );
    

    Then watch Inspector’s Console for output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Grid control (not a DataGrid) and I want to remove the
I want to change row and column definition index of a control in grid,
I developed a Grid Control and I want that when Tab is pressed it
I have a property grid control where I want to be able to display
I have a grid control. And I want to access gridview child control from
I'm using DevExpress's GridLookUpEdit control in a grid and I want the contents of
I want to control the mouse pointer with my application and be able to
I want to control does an element exist in document with its ID, when
i want to control my tab pages with custom buttons...now i want to hide
I want to control domainUpDown as spinner to control value from 0 to 800

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.