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

  • SEARCH
  • Home
  • 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 8331215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:20:50+00:00 2026-06-09T02:20:50+00:00

In my site, i have a page which is intended to handle a basic

  • 0

In my site, i have a page which is intended to handle a basic ticket system for bug tracking and feature requests. I need a grid to be displayed of the currently open requests with a button which allows the user to add new ones. I also want each row to have a button called ‘detail’ which will either open a new page or popup a frame (dont mind which) containing the history e.g. the dates, times and any commments that the bug/issue has had, status updates or comments and a simple form to allow the user to add new responses.

So far, I create a page to which i added a CRUD and used addColumn(‘button’,’detail’) to add a button to each row.

enter image description here

and the ATK4 code to create this is elegantly short like this

 <?php
  class page_ticket extends Page {
     function init() {
     parent::init();
     $p=$this;

     $team=$this->api->getTeamID();

     if (isset($_GET['detail'])) {
       $ticket=$_GET['detail'];
       $p->add('HtmlElement',null, 'crud')->setElement('h2')->set('Ticket History - ['.$ticket.']');
     } else {

       $tk=$p->add('CRUD_Ticket', null, 'crud');
       $m=$tk->setModel('Ticket', array('name', 'submit_date', 'status','ticket_type_id', 'urgency_id','description');

       $m->addCondition('status','TKO');

       $open=$this->api->db->dsql()->table('vscrum_ticket')
                  ->field('count(*)')
                  ->where('team_id',$team)
                  ->where('status','TKO')
                  ->do_getOne();
       ..   ..   ..

       $tk->grid->addQuickSearch(array('name'));
       $tk->grid->addPaginator(12);
  }

  $this->template->set('open_tickets', $open);
 } //End else detail
}

function defaultTemplate(){
    return array('page/ticket');
}

}

But the problem is i cant work out where the default functionality of the button is handled. At the moment, it will by default open the same page (ticket.php) passing the parameter but what happens is it opens a new window and gives an Ajax error as shown.

enter image description here

I have included an if then else in the page and in the error window, it displays my output correctly which is the Ticket ID of the row where the detail button was pressed. I can add the other detail later but why is it opening this in a new window instead of loading it in the frame ?

I assume it’s the default functionality of the CRUD as the buttons are normally edit or delete but how can i override this ?

If i wanted to open a different page, rather than the same one, i assume this would also be related to overriding the default functionality of the MVCGrid buttons which opens a frame using the javascript frameURL function.

The CRUD looks like this

  <?php
class CRUD_Ticket extends View {
    public $form=null;
    public $grid=null;

    public $grid_class='MVCGrid';
    public $form_class='MVCForm';

    public $frame_options=null;
    function init(){
    parent::init();

    if(isset($_GET[$this->name])){
        $this->api->stickyGET($this->name);

        $this->form=$this->add($this->form_class);
        $_GET['cut_object']=$this->name;

        return;
    }

    $this->grid=$this->add($this->grid_class);
    $this->js('reload',$this->grid->js()->reload());
    $this->add_button = $this->grid->addButton('Add Ticket');
    $this->add_button->js('click')->univ()
        ->frameURL('Add Ticket',$this->api->getDestinationURL(null,array($this->name=>'new')),$this->frame_options);

    }

    function setModel($a,$b=null){
    if($this->form){
        $m=$this->form->setModel($a,$b);

        if(($id=$_GET[$this->name])!='new'){
        $m->loadData($id);
        }

        if($this->form->isSubmitted()){
        $this->form->update(); 
                    $this->form->js(null,$this->js()
                         ->trigger('reload'))->univ()->closeDialog()->execute();
        }
        return $m;
    }
    $m=$this->grid->setModel($a,$c);

    $this->grid->addColumn('button','detail');
    if($id=@$_GET[$this->grid->name]){
        $this->js()->univ()->frameURL('Ticket History',$this->api->getDestinationURL(
                    null,array($this->name=>$id)))->execute();
    }
    return $m;
    }
}

I tried changing the call to frameURL to in the CRUD to

   $this->js()->univ()->page('ticketdtl',array($this->name=>$id)); 

and

   $this->js()->univ()->location($this->api->getDestinationURL('tktdetail',array($this->name=>$id))

but these also dont work as it still redirects to the original page so i think it must be default functionality that needs overriding somewhere – just cant figure out where ?

Went back to the agiletoolkit.org page here and realised that the demo where button is added to the Grid (B1 & B2) also exhibit same behaviour.

  • 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-06-09T02:20:51+00:00Added an answer on June 9, 2026 at 2:20 am

    The buttons in Agile Toolkit Grid send a request asking for some JavaScript response. When that response arrives, it can open a frame. As a result you need to do two requests instead of one.

    I have included a working example here:

    http://agiletoolkit.org/codepad/gui/grid#GridButton

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

Sidebar

Related Questions

I have a main page which looks like: <%@ Page Title= Language=C# MasterPageFile=~/Views/Shared/Site.Master Inherits=System.Web.Mvc.ViewPage
I have a WordPress site which have 4 pages with one page is a
I have on my site a blog-page on which you can add comments. The
I have google analytics on my site. One page has a button which when
We have been given a site xyz.com, in which the home page has images
I have a navigation menu within a page on my site, which has JavaScript
I have a site which uses largeish (60-100k) background images which vary from page
I have a site which uses Shadowbox-JS to bring up a settings page when
I have a Master Page which controls the styling of my site. In the
I'm using Facebook Likes in my site. I have a gallery page which shows

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.